Skip to main content
Brand and assets
Build
Monitor and contribute
/
Component library
  • All components
  • Buttons & actions
  • Forms & inputs
  • Layout & containers
  • Overlays
  • Feedback & status
  • Data display
  • Typography
    • A
    • AnimatedTypography
    • Code
    • Em
    • FormattedText
    • Heading
    • Highlight
    • List
    • Paragraph
    • Strike
    • Strong
    • Text
  • Accessibility
  • Contrib
  • Deprecated
  • Typography
  • AnimatedTypography

AnimatedTypography

Text and headings that slide up and fade in. Mobile only. Use to celebrate something the member just finished.

Health
Component health
Source
View on Github
Accessibility
unknown
Platform
Mobile
📱 Mobile-only
This component is only for mobile. To see how it looks like you can check the mobile storybook with:
yarn workspace alan-mobile dev:install-client -p ios
yarn workspace alan-mobile dev:storybook
  • Overview
  • Props
Loading...

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.

info

Mobile only. Not available on web — import from murray/mobile.

info

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.

ModeWhat animatesAuto-picked when
lettersEach letter, one by oneA single word of 8 characters or fewer
wordsEach word, one by oneFits on 1 line and is 5 words or fewer
linesEach line, one by oneWraps to 2–3 lines
blockThe whole text as one unitA long single word, 6+ words on one line, or 4+ lines
offNothing — 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 easeMoveIn curve.
  • Accessibility: respects the user's "reduce motion" setting.

AnimatedText props

NameTypeDefault ValueDescriptionUsage count
activebooleanundefinedtrueWhile 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
animationDelaynumberundefined0Delay in ms before the animation starts. Useful for staggering multiple AnimatedText components on the same screen.
animationModeAnimationModeundefinedautoControls 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-disabledbooleanundefined
aria-labelstringundefined
aria-levelnumberundefinedHeading level when paired with `role="heading"`.
asChild
5 possibilitiesboolean"web""except-style""except-style-web"undefined
children*stringText to animate. Must be a plain string — nested/formatted children are not supported.
classNamestringundefined
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
fontFamilyFontTokensundefined
htmlForstringundefined
idstringundefined
italicbooleanundefined
langLocaleOrLanguageundefined
loopForDebugbooleanundefinedfalseWhen true, the animation loops continuously. Debug/showcase only — do not use in product.
maxFontSizeMultipliernumbernullundefined
numberOfLinesnumberundefined
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.
roleRoleundefined
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">
tabIndexstringnumberundefined
tag"p""span"undefined
transform
6 possibilities"none""capitalize""uppercase""lowercase""unset"undefined
weightTextWeightundefined

Style API​

Use sx for one-off adjustments. It accepts these style keys:

accessibilityActionsaccessibilityElementsHiddenaccessibilityHintaccessibilityIgnoresInvertColorsaccessibilityLabelaccessibilityLabelledByaccessibilityLanguageaccessibilityLargeContentTitleaccessibilityLiveRegionaccessibilityRespondsToUserInteractionaccessibilityRoleaccessibilityShowsLargeContentVieweraccessibilityStateaccessibilityValueaccessibilityViewIsModalaccessibleadjustsFontSizeToFitalignContentalignItemsalignSelfallowFontScalingandroid_hyphenationFrequencyanimateOnlyanimatePresenceanimationaria-busyaria-checkedaria-disabledaria-expandedaria-hiddenaria-labelaria-labelledbyaria-livearia-modalaria-selectedaria-valuemaxaria-valueminaria-valuenowaria-valuetextasChildaspectRatiobackdropFilterbackfaceVisibilitybackgroundbackgroundAttachmentbackgroundBlendModebackgroundClipbackgroundColorbackgroundImagebackgroundOriginbackgroundPositionbackgroundRepeatbackgroundSizeblockSizeborderBlockColorborderBlockEndColorborderBlockEndStyleborderBlockEndWidthborderBlockStartColorborderBlockStartStyleborderBlockStartWidthborderBlockStyleborderBlockWidthborderBottomColorborderBottomEndRadiusborderBottomLeftRadiusborderBottomRightRadiusborderBottomStartRadiusborderBottomWidthborderColorborderCurveborderEndColorborderEndEndRadiusborderEndStartRadiusborderEndWidthborderImageborderInlineColorborderInlineEndColorborderInlineEndStyleborderInlineEndWidthborderInlineStartColorborderInlineStartStyleborderInlineStartWidthborderInlineStyleborderInlineWidthborderLeftColorborderLeftWidthborderRadiusborderRightColorborderRightWidthborderStartColorborderStartEndRadiusborderStartStartRadiusborderStartWidthborderStyleborderTopColorborderTopEndRadiusborderTopLeftRadiusborderTopRightRadiusborderTopStartRadiusborderTopWidthborderWidthbottomboxShadowboxSizingcaretColorchildrenclassNameclipPathcolorcolumnGapcomponentNamecontaincontainerTypecontentcursordangerouslySetInnerHTMLdataDetectorTypedebugdirectiondisableClassNamedisableOptimizationdisableddisabledStyledisplaydynamicTypeRampelevationellipseellipsizeModeendenterStyleexitStyleexperimental_backgroundImageexperimental_backgroundPositionexperimental_backgroundRepeatexperimental_backgroundSizefilterflexflexBasisflexDirectionflexGrowflexShrinkflexWrapfloatfocusStylefocusVisibleStylefocusWithinStylefontSizefontVariantfontVariationSettingsforceStylegapgridColumngridColumnEndgridColumnGapgridColumnStartgridRowgridRowEndgridRowGapgridRowStartgridTemplateAreasgridTemplateColumnsgroupheighthitSlophoverStylehtmlForidimportantForAccessibilityincludeFontPaddinginlineSizeinsetinsetBlockinsetBlockEndinsetBlockStartinsetInlineinsetInlineEndinsetInlineStartisolationjustifyContentleftletterSpacinglineBreakModelineBreakStrategyIOSlineHeightmarginmarginBlockmarginBlockEndmarginBlockStartmarginBottommarginEndmarginHorizontalmarginInlinemarginInlineEndmarginInlineStartmarginLeftmarginRightmarginStartmarginTopmarginVerticalmaskmaskBordermaskBorderModemaskBorderOutsetmaskBorderRepeatmaskBorderSlicemaskBorderSourcemaskBorderWidthmaskClipmaskCompositemaskImagemaskModemaskOriginmaskPositionmaskRepeatmaskSizemaskTypematrixmaxBlockSizemaxFontSizeMultipliermaxHeightmaxInlineSizemaxWidthminBlockSizeminHeightminInlineSizeminWidthminimumFontScalemixBlendModenativeIDnumberOfLinesobjectFitonAccessibilityActiononAccessibilityEscapeonAccessibilityTaponBluronFocusonHoverInonHoverOutonLongPressonMagicTaponMouseDownonMouseEnteronMouseLeaveonMouseUponPressonPressInonPressOutopacityoutlineColoroutlineOffsetoutlineStyleoutlineWidthoverflowoverflowBlockoverflowInlinepaddingpaddingBlockpaddingBlockEndpaddingBlockStartpaddingBottompaddingEndpaddingHorizontalpaddingInlinepaddingInlineEndpaddingInlineStartpaddingLeftpaddingRightpaddingStartpaddingToppaddingVerticalpassThroughperspectivepointerEventspositionpressRetentionOffsetpressStylerightrolerotaterotateXrotateYrotateZrotationrowGapscalescaleXscaleYscreenReaderFocusablescrollbarWidthselectableselectionColorseparatorshadowColorshadowOffsetshadowOpacityshadowRadiusskewXskewYspacespaceDirectionstartstylesuppressHighlightingtabIndextagtargettestIDtextAligntextAlignVerticaltextBreakStrategytextDecorationColortextDecorationDistancetextDecorationLinetextDecorationStyletextEmphasistextOverflowtextShadowColortextShadowOffsettextShadowRadiustextTransformtextWrapthemethemeInversethemeShallowtoptouchActiontransformtransformMatrixtransformOrigintransformStyletransitiontranslateXtranslateYuntilMeasureduserSelectverticalAlignwhiteSpacewidthwordWrapwritingDirectionxyzIndex

Each can be overridden per breakpoint with:

$group-focus$group-focusVisible$group-focusWithin$group-hover$group-lg$group-lg-focus$group-lg-focusVisible$group-lg-focusWithin$group-lg-hover$group-lg-press$group-ltLg$group-ltLg-focus$group-ltLg-focusVisible$group-ltLg-focusWithin$group-ltLg-hover$group-ltLg-press$group-ltMd$group-ltMd-focus$group-ltMd-focusVisible$group-ltMd-focusWithin$group-ltMd-hover$group-ltMd-press$group-ltSm$group-ltSm-focus$group-ltSm-focusVisible$group-ltSm-focusWithin$group-ltSm-hover$group-ltSm-press$group-ltVs$group-ltVs-focus$group-ltVs-focusVisible$group-ltVs-focusWithin$group-ltVs-hover$group-ltVs-press$group-ltXl$group-ltXl-focus$group-ltXl-focusVisible$group-ltXl-focusWithin$group-ltXl-hover$group-ltXl-press$group-ltXxl$group-ltXxl-focus$group-ltXxl-focusVisible$group-ltXxl-focusWithin$group-ltXxl-hover$group-ltXxl-press$group-md$group-md-focus$group-md-focusVisible$group-md-focusWithin$group-md-hover$group-md-press$group-press$group-sm$group-sm-focus$group-sm-focusVisible$group-sm-focusWithin$group-sm-hover$group-sm-press$group-vs$group-vs-focus$group-vs-focusVisible$group-vs-focusWithin$group-vs-hover$group-vs-press$group-xl$group-xl-focus$group-xl-focusVisible$group-xl-focusWithin$group-xl-hover$group-xl-press$group-xs$group-xs-focus$group-xs-focusVisible$group-xs-focusWithin$group-xs-hover$group-xs-press$group-xxl$group-xxl-focus$group-xxl-focusVisible$group-xxl-focusWithin$group-xxl-hover$group-xxl-press$lg$ltLg$ltMd$ltSm$ltVs$ltXl$ltXxl$md$platform-android$platform-ios$platform-native$platform-web$sm$vs$xl$xs$xxl
Edit this page
Previous
A
Next
Code
  • When to use
  • Success screen layout
  • Usage
  • Choosing how the text animates (animationMode)
  • Staggering several pieces (animationDelay)
  • Waiting for the screen to settle (active)
  • The motion, in short