AnimatedTypography
Text and headings that slide up and fade in. Mobile only. Use to celebrate something the member just finished.
yarn workspace alan-mobile dev:install-client -p ios
yarn workspace alan-mobile dev:storybook
- Overview
- Props
AnimatedText and AnimatedHeading are mobile-only typography components that reveal text with a slide-up + fade-in animation. Use them to celebrate a user action on success screens — for example, when a member completes a daily challenge.
They wrap Murray's Text and Heading, so they accept all the same props (size, weight, color, align…) plus the animation props below. Both share the same animation props. Their children must be a plain string — nested or formatted children aren't supported.
Mobile only. Not available on web — import from murray/mobile.
Mobile components can't animate in this browser-based doc. The preview below shows the layout with static Heading + Text; to see the reveal in motion, run the app locally or use the Mobile/AnimatedTypography stories in Storybook mobile.
When to use
- ✅ Success moments — a confirmation, a completed action, a celebratory screen.
- ✅ When you want typography to feel alive as the screen appears.
- ❌ Not for everyday body text, lists, or dense content — reserve motion for moments that deserve it.
- ❌ Web modules — these are mobile-only.
Motion here is opt-in: existing Text / Heading usages are untouched. You only get animation where you explicitly reach for these components. For this first iteration they're scoped to success screens only — that guardrail may expand as more use cases appear.
Success screen layout
A typical success screen pairs an AnimatedHeading with an AnimatedText below it, staggered so the body follows the title. The preview shows the layout; the code shows how you'd build it with animation.
Congratulations!
Your daily challenge is complete. Come back tomorrow for the next one.
Usage
import { AnimatedText, AnimatedHeading } from "murray/mobile";
<AnimatedHeading size="xl">Congratulations!</AnimatedHeading>
<AnimatedText size="$text300">Your request was approved.</AnimatedText>
Choosing how the text animates (animationMode)
By default the component auto-detects the nicest way to reveal the text, based on its length and how many lines it wraps to. Override it with the animationMode prop.
| Mode | What animates | Auto-picked when |
|---|---|---|
letters | Each letter, one by one | A single word of 8 characters or fewer |
words | Each word, one by one | Fits on 1 line and is 5 words or fewer |
lines | Each line, one by one | Wraps to 2–3 lines |
block | The whole text as one unit | A long single word, 6+ words on one line, or 4+ lines |
off | Nothing — renders as plain text | (never auto-picked; set it manually to disable) |
// Let the component decide (default)
<AnimatedText size="$text400">Limited Time Offer</AnimatedText>
// Force a specific mode
<AnimatedText size="$text500" weight="bold" animationMode="letters">
DONE
</AnimatedText>
Staggering several pieces (animationDelay)
To make a heading and its body animate in sequence rather than all at once, give the later element a delay in milliseconds:
<AnimatedHeading size="xl">Congratulations!</AnimatedHeading>
<AnimatedText size="$text300" animationDelay={150}>
Your request was approved.
</AnimatedText>
Waiting for the screen to settle (active)
If the animation should only start after the screen's own entrance transition finishes, hold it back with active. While active is false the text stays hidden; flip it to true to trigger the reveal.
<AnimatedHeading size="xl" active={isTransitionEnded}>
Welcome back
</AnimatedHeading>
The motion, in short
- Movement: text slides up into place (from 1.5× its font size below) while fading in.
- Duration: ~1.25s for a smooth, deliberate reveal.
- Easing: Murray's
easeMoveIncurve. - Accessibility: respects the user's "reduce motion" setting.
AnimatedText props
| Name | Type | Default Value | Description | Usage count |
|---|---|---|---|---|
| active | booleanundefined | true | While false, the text is held hidden (and offset) and the reveal does not start until this flips to true. Lets a screen defer the animation until its enter transition ends. | |
| align | 9 possibilities"unset""end""left""right""start""auto""center""justify"undefined | |||
| animationDelay | numberundefined | 0 | Delay in ms before the animation starts. Useful for staggering multiple AnimatedText components on the same screen. | |
| animationMode | AnimationModeundefined | auto | Controls how the text is split and animated. - `auto` (default): detects best mode based on word/line count - `letters`: animate character by character (best for single words) - `words`: animate word by word (best for 2–4 words) - `lines`: animate line by line (best for short paragraphs) - `block`: animate entire text as one unit - `off`: no animation, renders as plain Text | |
| aria-disabled | booleanundefined | |||
| aria-label | stringundefined | |||
| aria-level | numberundefined | Heading level when paired with `role="heading"`. | ||
| asChild | 5 possibilitiesboolean"web""except-style""except-style-web"undefined | |||
| children* | string | Text to animate. Must be a plain string — nested/formatted children are not supported. | ||
| className | stringundefined | |||
| color | 4 possibilitiesundefined`$${string}`Variable<any>OpaqueColorValue | Color prop accepts Tamagui color tokens, ColorTokens, or dynamic token strings. Examples: "$grey900", "$indigo500", "$white", or dynamically constructed tokens like `$${name}900` | ||
| dir | "auto"Directionundefined | |||
| ellipsizeMode | "clip""head""middle""tail"undefined | |||
| fontFamily | FontTokensundefined | |||
| htmlFor | stringundefined | |||
| id | stringundefined | |||
| italic | booleanundefined | |||
| lang | LocaleOrLanguageundefined | |||
| loopForDebug | booleanundefined | false | When true, the animation loops continuously. Debug/showcase only — do not use in product. | |
| maxFontSizeMultiplier | numbernullundefined | |||
| numberOfLines | numberundefined | |||
| onLayout | ((e: LayoutChangeEvent) => void)undefined | |||
| onTextLayout | 2 possibilitiesundefined(e: NativeSyntheticEvent<TextLayoutEventData>) => void | Fires on mobile with the list of rendered lines. Passes through to the underlying RN Text. | ||
| role | Roleundefined | |||
| size | 9 possibilitiesundefinednumberVariable<any>"$text100""$text200""$text300""$text400""$text500"Partial<Record<"$xs" | "$sm" | "$md" | "$lg" | "$ltVs" | "$vs" | "$ltSm" | "$ltMd" | "$ltLg" | "$ltXl" | "$xl" | "$ltXxl" | "$xxl", TextSize>> | Font size and line height token, see `TypographyBaseProps["size"]`. Also accepts one size per breakpoint, e.g. `{ $xs: "$text200", $lg: "$text300" }`: widths that no key matches keep the default or inherited size. | ||
| sx | 2 possibilitiesundefinedOmit<TextProps, "fontFamily" | "fontStyle" | "fontWeight"> | |||
| tabIndex | stringnumberundefined | |||
| tag | "p""span"undefined | |||
| transform | 6 possibilities"none""capitalize""uppercase""lowercase""unset"undefined | |||
| weight | TextWeightundefined |
Style API
Use sx for one-off adjustments. It accepts these style keys:
Each can be overridden per breakpoint with: