Kinetik UI

Letter Morph

.md

A label that morphs letter by letter: shared letters slide to new places as others float away or rise in.

v1.0.0Live on webreact-native-reanimatedreact-native-worklets
Component preview

Installation

Kinetik CLI
npx kinetik-ui add letter-morph

The CLI copies the source and installs native dependencies with npx expo install, so versions match your Expo SDK. With shadcn: npx shadcn@latest add https://kinetik-ui.dev/r/letter-morph.json

Install manually

  1. Install dependencies
    npx expo install react-native-reanimated react-native-worklets
  2. Copy the source files
    • components/kinetik/letter-morph.tsx
    View source files

Usage

import { LetterMorph } from '@/components/kinetik/letter-morph';

const label = following ? 'Following' : 'Follow';

<Pressable accessibilityRole="button" accessibilityLabel={label} onPress={toggle}>
  <LetterMorph text={label} textStyle={{ fontSize: 16 }} />
</Pressable>;

Change text and the letters the old and new text share slide to their new places, while the others float away or rise in.

When to use

  • Labels that change state in place: Follow to Following, Save to Saved, Add to Added.
  • Short headlines that cycle through related words.

When not to use

  • Long text or paragraphs. Each letter is its own view.
  • Numbers that count. Use Odometer.

Notes

  • Letters are matched in order, so a letter is never pulled across another to reach its new place.
  • Each letter is drawn separately, so kerning pairs are not applied. It is rarely visible at label sizes; check it with your typeface at large sizes.
  • The label is read as one piece of text; the letters are hidden from screen readers. Inside a button, give the button the same accessibilityLabel.
  • With reduced motion the new text replaces the old at once.

Props

LetterMorphProps

PropTypeDefaultDescription
textrequiredstring—The text. Change it and shared letters slide to their new places.
textStyleStyleProp<TextStyle>—Style for the letters. Defaults to a large, semibold line in the theme text colour.
accessibilityLabelstring—Read by screen readers. Defaults to the text.
testIDstring—
styleStyleProp<ViewStyle>—

Performance and accessibility

Performance

Budget
One text view per letter, moved by transforms on the UI thread; each new character is measured once. Nothing runs at rest.
Measured

Pixel 9 emulator, API 35, release build · interaction median 0.90× the system Settings app on the same emulator (indicative only) · keeps drawing at rest · 161 MB app memory. The demo changes the headline every 1.8 s, so it draws at rest; the long p99 frame is the first appearance of a new character, which is measured once.

Real-device measurement pending.

Accessibility

Reduced motion
The new text replaces the old at once.
Screen readers
One text element that reads the whole label; the letters themselves are hidden.
Touch target
Not interactive itself; put it inside a button for actions.

Source files

components/kinetik/letter-morph.tsx is in the Code tab of the preview above.