Character-level FLIP animations powered by Reanimated. Each character finds its way to the right place.
npm install morph-text-native
import { MorphText } from 'morph-text-native';
function StatusLabel({ text }) {
return (
<MorphText
style={{ fontSize: 16, fontWeight: '600' }}
duration={400}
>
{text}
</MorphText>
);
}
// Text morphs between messages instead of stacking toasts
<Animated.View entering={SlideInDown.duration(300)}>
<AnimatedIcon type={type} />
<MorphText
style={{ fontSize: 16, color: theme.text }}
duration={300}
>
{message}
</MorphText>
</Animated.View>
a gets id "a", second gets "a-5".children.| Prop | Type | Default | Description |
|---|---|---|---|
| children | string | — | Text to display and morph between |
| style | TextStyle | — | Style for each character |
| containerStyle | ViewStyle | — | Style for the outer container |
| duration | number | 400 | Animation duration in ms |
| ease | EasingFunction | bezier(0.19, 1, 0.22, 1) | Reanimated easing function |
| scale | boolean | true | Scale entering characters from 0.95 |
| onAnimationStart | () => void | — | Fires when animation starts |
| onAnimationComplete | () => void | — | Fires when animation ends |