The Text component is the foundation for all text rendering in the design system. It provides consistent typography with semantic color and size options. Aidos is designed and documented with Geist Sans, while library components inherit the host application's font family.
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
| children | ReactNode | Yes | - | Text content |
| color | TextColor | No | "primary" | "primary", "secondary", "highlight", "negative", "subtle", "light", "inherit" |
| size | Size | No | "medium" | "xsmall", "small", "medium", "large", "xlarge", "xxlarge", "xxxlarge" |
| bold | boolean | No | false | Semibold emphasis |
| ellipsis | boolean | No | varies | Truncate text with ellipsis when overflow |
| align | "center" | "none" | No | "none" | Text alignment |
| type | TextType | No | "span" | HTML element: "span", "p", "h1", "h2", "h3", "h4", "li", "label" |
| grow | boolean | No | false | Allow text to grow in flex container |
For most use cases, prefer the semantic wrapper components over the base Text component. They provide sensible size defaults and render the appropriate HTML elements. Heading weight remains explicit rather than being inferred from document rank.
P - Paragraph text for body content
Span - Inline text (truncates by default)import { H1, H2, H3, H4, P, Span, Li, Label } from "aidos-ui";
<H1>Page Title</H1> // xxlarge, renders <h1>
<H2>Section Heading</H2> // xlarge, renders <h2>
<H3>Subsection</H3> // large, renders <h3>
<H4>Component title</H4> // medium, renders <h4>
<P>Body text paragraph</P> // medium, renders <p>
<Span>Inline text</Span> // medium, renders <span>, ellipsis enabled
<Li>List item</Li> // medium, renders <li>
<Label>Form label</Label> // medium, renders <label>
Use bold when the visual treatment should also be heading-like:
<H1 bold>Visually emphasized page title</H1>
<H2 bold>Visually emphasized section title</H2>
Each size defines both font size and proportional line height. Font sizes map to CSS custom properties. Heading level and weight remain separate: H1 through H4 choose a semantic element and default size, while bold or jss controls emphasis.
| Size | Default metrics | Intended use |
|---|---|---|
| xsmall | 10 / 14 | Dense, nonessential metadata only |
| small | 12 / 16 | Captions, labels and secondary text |
| medium | 14 / 20 | Component and compact body text |
| large | 18 / 24 | Subsection headings |
| xlarge | 22 / 28 | Section headings |
| xxlarge | 28 / 34 | Page headings |
| xxxlarge | 36 / 42 | Display text and metrics |
<Text size="xsmall">Fine print</Text>
<Text size="small">Secondary text</Text>
<Text size="medium">Body text</Text>
<Text size="large">Emphasized</Text>
<Text size="xlarge">Subheading</Text>
<Text size="xxlarge">Title</Text>
<Text size="xxxlarge">Hero</Text>
Semantic colors ensure text adapts correctly to light and dark themes.
<Text color="primary">Main content</Text>
<Text color="secondary">Supporting info</Text>
<Text color="highlight">Accent text</Text>
<Text color="negative">Error message</Text>
<Text color="subtle">Disabled text</Text>
<Text bold>Important information</Text>
<Text>Regular text</Text>
By default, Span and Label components truncate text with ellipsis. Other components wrap by default.
This paragraph text will wrap to multiple lines when it exceeds the container width instead of truncating
// Truncates by default
<Span>Long text that will be truncated...</Span>
// Force truncation on any text component
<P ellipsis>This paragraph will truncate</P>
// Disable truncation on span
<Span ellipsis={false}>This span will wrap</Span>
Override the rendered HTML element while keeping the same styling using the type prop.
// Render H1 styling but use h2 element (for accessibility)
<H1 type="h2">Visually large, semantically h2</H1>
// Render span styling as a label
<Span type="label" htmlFor="email">Email address</Span>