Typography
Nine text styles, from page headings to muted captions, that render as a single <text> element.
Installation
Typography imports class-variance-authority (see Installation).
Usage
<ui-text> wraps its content in a <text> element and sets the color for you, so the text follows your theme.
Variants
Custom classes
Your classes replace the variant's classes where they conflict, so text-primary wins over text-foreground.
Line limit
maxLines stops the text after that many lines and ends the last one with "…". It sets Lynx's text-maxline attribute and the text-ellipsis class together: text-maxline alone only sizes the box, so Android draws the lines past it over whatever follows, and iOS cuts them off with no "…". Without maxLines, the text takes every line it needs.
API
UiText
No outputs.
The file also exports typographyVariants and the TypographyVariant type.
Related
<text>: the element it renders- Theming: the
foregroundandmuted-foregroundcolors - Custom fonts
