Text
A body text component with size, weight, family, color, and line-height variants. Renders as a paragraph by default with polymorphic element support.
Sizes
Extra small text
Small text
Medium text (default)
Large text
Extra large text
Weights
Normal weight (default)
Medium weight
Semibold weight
Bold weight
Colors
Primary text color
Secondary text color
Tertiary text color
Warning text color
color="warning" reads --text-warning, for a state line such as "Unsaved changes".
color="success" reads --text-success, for a settled figure such as "Total $400 of $400".
color="amber" reads --text-amber and falls back to --text-warning, so a theme can bind a
second amber (a held line, say) without moving warning.
Total $400 of $400
Held
Family
family="mono" sets the face to --font-mono (falling back to ui-monospace, monospace) for a
figure: a fee, a count, a masked last four. It composes with every size, weight and color. The
default, body, is the face Text has always had.
$400
•••• 4242
$400 of $400
Theming
A theme sets each size's type size, case and tracking through the text
component tokens — --text-<size>-font-size, -text-transform and
-letter-spacing — without a new size. See
Component tokens.
components:
text:
sm-font-size: "13px"
xs-text-transform: uppercase
xs-letter-spacing: "0.12em"Eyebrow
size="eyebrow" is an all-caps label above a section, laid out as a row so a leading
dot or icon sits beside it. It takes its weight and colour from the --text-eyebrow-*
hooks (semibold, --text-secondary) unless you pass weight or color, and its case
and tracking match PageHeader's eyebrow.
Your Shifts
Your Roles at Campout 2027
A theme binds the eyebrow under components.text:
components:
text:
eyebrow-font-size: "12px"
eyebrow-font-weight: "680"
eyebrow-letter-spacing: "0.08em"
eyebrow-color: "var(--ink-64)"In Five Looks
The itinerary's labels in each look, on the theme picked in the docs: the offline pill from the top bar, and a tile of eyebrows with role dots and chips. The specimen binds the Honcho kit's sizes the way a theme would, and reads the theme's fill and inks. Only the two Photo looks turn glass on: the tile and the pill turn to glass, while the chips, dots and eyebrows never blur themselves.
Line Height
The leading prop controls line height. Use relaxed or loose for long-form body text.
Tight — The quick brown fox jumps over the lazy dog. Pack my box with five dozen liquor jugs.
Snug — The quick brown fox jumps over the lazy dog. Pack my box with five dozen liquor jugs.
Normal (default) — The quick brown fox jumps over the lazy dog. Pack my box with five dozen liquor jugs.
Relaxed — The quick brown fox jumps over the lazy dog. Pack my box with five dozen liquor jugs.
Loose — The quick brown fox jumps over the lazy dog. Pack my box with five dozen liquor jugs.
Polymorphic Element
Use the as prop to render as a different HTML element.
Paragraph (default)
Inline spanInstallation
npx visor add textThis copies two files into your project:
components/ui/text/text.tsx— the componentcomponents/ui/text/text.module.css— the styles
Usage
import { Text } from '@/components/ui/text/text';
export default function Example() {
return <Text>This is a paragraph of body text.</Text>;
}API Reference
TextProps
| Prop | Type | Default | Description |
|---|---|---|---|
as | 'p' | 'span' | 'div' | 'label' | 'p' | HTML element to render. |
size | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'eyebrow' | 'md' | Font size of the text. `eyebrow` is an all-caps label laid out as a row for a leading dot or icon; it takes its weight and colour from the `--text-eyebrow-*` hooks unless `weight` or `color` is passed. |
weight | 'normal' | 'medium' | 'semibold' | 'bold' | 'normal' | Font weight of the text. |
color | 'primary' | 'secondary' | 'tertiary' | 'inherit' | 'primary' | Text color mapped to semantic color tokens. |
leading | 'tight' | 'snug' | 'normal' | 'relaxed' | 'loose' | 'normal' | Line height of the text. |
className | string | — | Additional CSS class names to merge onto the element. |
The component also accepts all standard HTML paragraph attributes.
Accessibility
- Use
color="secondary"orcolor="tertiary"with care — these map to lower-contrast tokens. Verify contrast ratios meet WCAG AA (4.5:1) for any informational text. - Prefer
leading="relaxed"for body copy longer than two lines; it improves readability for users with dyslexia. - Use
as="label"with anhtmlForprop when pairing with form inputs, rather than wrapping aLabelcomponent. - Avoid using
Textfor headings — useHeadingto maintain a proper document outline.
Customization
After copying the component, you own it completely. Common customizations:
// Truncate to a single line with ellipsis
<Text className="truncate">Very long text that gets cut off...</Text>
// Combine with color="inherit" for themed contexts
<Text color="inherit" size="sm">Inherits color from parent</Text>