Text
Pre-alphaThe registry and the CLI are not published yet.Roadmap

Text

Body text wired to typography, content colors and semantic variants.

Installation

npx axiom add text
pnpm dlx axiom add text
yarn dlx axiom add text
bun x axiom add text

Usage

import { Text } from '@/components/ui/text';

<Text>Your changes are saved automatically.</Text>
<Text variant="footnote" color="muted">Last synced 2 minutes ago</Text>
<Text variant="bodySm" color="error">Sync failed</Text>

Variants

variant sets the typography, color sets the meaning. Each variant points to a typography token.

VariantTokenSize / line height · weightUse for
bodyLgbody17/22 · 400Main reading text
bodycallout16/21 · 400Default body text
bodySmsubheadline15/20 · 400List rows, descriptions
footnotefootnote13/18 · 400Helper text, metadata
captioncaption12/16 · 400Labels under images, timestamps

Colors

ColorTheme colorUse for
defaultcontent.defaultRegular text
mutedcontent.mutedSecondary text, descriptions
subtlecontent.subtleCaptions, hints
disabledcontent.disabledText of a disabled element
inversecontent.inverseText on an inverse background
linkcontent.linkLinks and text actions
successfeedback.successConfirmation messages
warningfeedback.warningWarnings
errorfeedback.errorErrors, validation messages

System text size

Text follows the text size set in the system settings (Dynamic Type on iOS, font size on Android). Running text has no cap: let it wrap and its container grow.

Inside components, MAX_FONT_SCALE caps the size through maxFontSizeMultiplier:

CapValueUsed by
MAX_FONT_SCALE.control1.5Labels of components that grow with their text: Button, Input, Chip, Segmented control
MAX_FONT_SCALE.fixed1.2Text inside a shape that keeps its size: Avatar initials, Badge, Calendar days, Input OTP cells
import { MAX_FONT_SCALE, Text } from "@/components/ui/text";

<Text numberOfLines={1} maxFontSizeMultiplier={MAX_FONT_SCALE.control}>
	Save
</Text>;

Props

PropTypeDefaultDescription
variant'bodyLg' | 'body' | 'bodySm' | 'footnote' | 'caption''body'Typography style. See Variants.
color'default' | 'muted' | 'subtle' | 'disabled' | 'inverse' | 'link' | 'success' | 'warning' | 'error''default'Theme color. See Colors.
weight'regular' | 'medium' | 'semibold' | 'bold'from the variantOverrides the variant’s weight, e.g. to highlight a word.
align'left' | 'center' | 'right''left'Text alignment.
numberOfLinesnumberTruncates with an ellipsis after this many lines.
asChildbooleanfalsePasses the styles to the child instead of rendering a Text. See Slot.
styleStyleProp<TextStyle>Extra styles, applied after the variant.

Text also accepts every React Native Text prop. A nested Text inherits the parent’s variant and color unless it sets its own.