Text
Renders a single text node as any semantic HTML element. Uses design tokens for size, weight, and color so text always respects the consumer’s theme.
Add via CLI
Section titled “Add via CLI”npx @a2ra/cli add textColors
Section titled “Colors”Semantic elements
Section titled “Semantic elements”Example JSON
Section titled “Example JSON”{ "type": "Text", "props": { "as": "h2", "size": "xl", "weight": "semibold", "color": "default" }, "children": "Account settings"}| Prop | Type | Description |
|---|---|---|
as | p defaulth1h2h3h4spanlabel | HTML element to render |
size | xssmmd defaultlgxl2xl | Font size |
weight | normal defaultmediumsemiboldbold | Font weight |
color | default defaultmutedprimarydanger | Text color token |
align | left defaultcenterrightjustify | Text alignment |
italic | truefalse default | Italic style |
truncate | truefalse default | Single-line truncation with ellipsis |
children | stringnode[] | Text content |
- Use
asto choose the right semantic element. All font size and weight values are independent of the element, soas: "h2"does not automatically make the text large. truncate: trueaddsoverflow-hidden text-ellipsis whitespace-nowrapand requires a fixed or constrained width on the parent to take effect.