Text reveal
A restrained staggered line with whole-run shaping fallbacks.
npx @swipeui/cli add text-revealVariant
Preset
Material
Scheme
Feel
When to use it
- Onboarding headlines or welcome messages that appear word by word.
- Section titles on a landing screen that reveal when shown.
- Quiet emphasis for one important line.
When not to use it
- Body text or anything people need to read quickly.
- Repeated UI labels; it gets tiring.
- Long lines.
Installation
Run this from your app's root. If SwipeUI isn't set up yet, run npx @swipeui/cli init first; it sets up Uniwind, the theme tokens and the cn helper.
npx @swipeui/cli add text-reveal- Adds
components/swipeui/ui/text-reveal.tsxand 4 shared helpers. - Installs react-native-reanimated, react-native-worklets, clsx, tailwind-merge, class-variance-authority. In Expo apps it uses
npx expo installso versions match your SDK.
Usage
import { TextReveal } from '@/components/swipeui/ui/text-reveal';
<TextReveal text="Make room for what matters" />;Examples
word, character, line. The app and website share content, named boards and compact outside controls.
Settings
| Setting | Default | Behavior |
|---|---|---|
text | required | Complete visible and spoken text. |
by | 'word' | 'word', 'character' or newline-delimited 'line'. Shaped scripts stay whole. |
direction | 'up' | Enter from below, above ('down'), or fade in place ('none'). |
delay | 0 | Nonnegative finite milliseconds before the first segment. |
onRevealEnd | absent | Called once after the last entrance finishes, including the reduced-motion fade. |
visible | true | Mount and reveal the text. |
motion | app feel | Shared list/fade feel. |
className | absent | Root classes. |
textClassName | 'text-title-2' | Text style classes. |
style | absent | Native layout escape hatch. |
testID | absent | Root and segment IDs. |
Accessibility
The complete text is one accessible label; animated copies are hidden. Shaped scripts stay whole. Reduce Motion preserves the meaning. Native screen-reader, Dynamic Type and performance checks remain pending at 7.9.
Behavior and gestures
- Add explicit line reveal, independent direction and delay, and one completion callback. Shaped scripts stay whole; Reduce Motion keeps a completion fade.
- The application owns its content; demo controls sit outside the item.
Accessibility
- The full line is read once, not piece by piece.
- Joined scripts are revealed as a whole so letters keep their shapes.
- Reduce Motion shows the line at once.
Motion
- Uses the
listmotion role, so it follows your app's feel. Passmotionto tune this one instance. - Add explicit line reveal, independent direction and delay, and one completion callback. Shaped scripts stay whole; Reduce Motion keeps a completion fade.
- Native runtime evidence remains pending at 7.9.
Performance
- Each word or character is a small animated view; keep it to one line.
Notes for AI
- Use by="word" for most text; characters only for very short lines.
Compatibility
| Runs on | Supported |
|---|---|
| Expo SDK 57 | Yes |
| Expo SDK 58 | Yes |
| React Native CLI (with Expo modules) | Yes |
| Expo Go | Yes |
| iOS | Yes |
| Android | Yes |
This table describes API support and static bundle checks. Native runtime, device accessibility and bare Uniwind compatibility remain pending.