Typography
Heading and Text over the token-driven type scale: level is the document outline, size is the rung, tone is the color role, className stays layout-only. A bare text-* rung is for HTML React doesn't render as components, such as email HTML; MDX maps its tags to Heading and Text.
Composition
Heading and Text
Heading takes level (the document outline) and size (the rung); they are decoupled on purpose, so an h3 may wear heading-2. Text takes as, size, weight, and tone. className is for layout only: size, weight, face, and color come from props.
- page section
- <Heading />
- <Text />
Native tag
A native tag may wear one text-* rung and nothing else from the scale: pair it with a tone or weight and it becomes Text or Heading. Heading rungs already carry font-display and text-balance.
- one rung on the element
- <h2 />
- <p />
Installation
The Control UI source installs this component from src/registry/sources/control-ui/ui/typography.tsx.
Dependencies
src/registry/sources/control-ui/ui/markdown-heading.tsSupportsrc/registry/sources/control-ui/theme.cssSupportRaw code
Primary installed source