TextProps

Inline text or a formatted animated number.

Source
type TextProps<T extends ElementType = 'span'> = PrimitiveProps<T> & {
  size?: Ramp | 'caption'
  weight?: 'regular' | 'medium' | 'semibold' | 'bold'
  color?: 'primary' | 'secondary' | 'tertiary' | 'accent'
  value?: number
  format?: Intl.NumberFormatOptions
  suffix?: string
}

size names a step of Dynamic Type, which carries size, leading, tracking and weight together. weight emphasises the step on the HIG ladder. caption is the kit's original name for shared.sub and still renders as it did; prefer size="footnote" color="secondary" in new UI.

API reference

type TextProps<T extends ElementType = 'span'> = PrimitiveProps<T> & {
  size?: Ramp | 'caption'
  weight?: 'regular' | 'medium' | 'semibold' | 'bold'
  color?: 'primary' | 'secondary' | 'tertiary' | 'accent'
  value?: number
  format?: Intl.NumberFormatOptions
  suffix?: string
}

Related types