Skip to main content

Typography

Astryx Text and Heading through Agata's design-system boundary.
2 min read

Scale#

Use Astryx Text and Heading semantic props first. Raw sizes come from textSizeVars (--font-size-4xs … --font-size-5xl) and semantic type combinations come from typeScaleVars (see Foundations).

@agata/ui/components/text exports Astryx Text and Heading. Prefer the semantic type and heading level axes; explicit sizes are for metrics and other cases where the semantic scale does not fit.

Use the semantic Astryx type scale for line height and tracking. Do not create feature-local typography variables or utility scales.

The Text component#

Use the props exposed by @agata/ui/components/text:

PropTypical options
typebody, large, label, supporting, code, display-*
colorAstryx primary, secondary, accent, disabled, placeholder, and inherit; the Agata boundary preserves status/trend names by mapping them directly to official Astryx color tokens
size / weightExplicit overrides when a semantic type is insufficient
maxLinesLine clamp with the built-in truncation tooltip
hasTabularNumbersAligned numeric columns and KPIs
xstyleStyleX layout/customization owned by the caller

Agata preserves native paragraph flow: Text as="p" defaults to display="block", while the default span remains inline. An explicit display prop always takes precedence.

Headings#

  • Heading renders semantic h1–h6 elements and uses the themed type scale.
  • Use accessibilityLevel only when a reusable component's visual level must differ from its document outline.
  • Font families come from Astryx typographyVars; do not introduce a local editorial font token.

Numbers#

Use hasTabularNumbers on Text for finance tables and KPIs.

RoleRecipe
Page titleHeading level={1}
SectionHeading level={2} or level={3} according to the outline
BodyText type="body"
Meta / helperText type="supporting" or color="secondary"

i18n#

Product copy lives in app messages (en is the source, es the translation). Generic components receive labels as props; localized guidance compositions belong in the app.