Components
Typography
Semantic text components, heading levels, sizes, weights, and overflow controls.
Orkest UI provides a small typography family built on the Text primitive. Each component renders
the correct native element by default and shares the same size, weight, color, alignment, spacing,
and overflow options.
Use these components instead of styling headings and paragraphs ad hoc. For the underlying font tokens, see Typography foundations.
Live preview#
Release notes
The typography family keeps semantic HTML and visual styles separate. Use level for heading semantics and shared options for rhythm.
import { Caption, Code, Heading, Link, Paragraph, Stack, Strong } from '@orkest/ui';
export function Example() {
return (
<Stack gap={3}>
<Heading level={3}>Release notes</Heading>
<Paragraph>
The <Strong>typography</Strong> family keeps semantic HTML and visual styles separate. Use{' '}
<Code>level</Code> for heading semantics and{' '}
<Link href="/docs/components/text/">shared options</Link> for rhythm.
</Paragraph>
<Caption>Updated 12 minutes ago</Caption>
</Stack>
);
}Heading levels#
level sets both the rendered heading element and the default size. Level 1 renders an h1 at the
5xl size; the preview below starts at level 2 because the documentation page already owns its h1.
Level 2 heading
Level 3 heading
Level 4 heading
Level 5 heading
Level 6 heading
import { Heading, Stack } from '@orkest/ui';
export function Example() {
return (
<Stack gap={2}>
<Heading level={2}>Level 2 heading</Heading>
<Heading level={3}>Level 3 heading</Heading>
<Heading level={4}>Level 4 heading</Heading>
<Heading level={5}>Level 5 heading</Heading>
<Heading level={6}>Level 6 heading</Heading>
</Stack>
);
}Use as when the visual level and the document structure need to differ, and size to override the
visual size without changing semantics.
Text sizes#
The full type scale is available on Text and all semantic text components. inherit keeps the
surrounding size, which is useful for inline elements such as Strong, Code, and Link.
import { Stack, Text } from '@orkest/ui';
export function Example() {
return (
<Stack gap={1}>
<Text size="2xs">2xs · 12px</Text>
<Text size="xs">xs · 13px</Text>
<Text size="sm">sm · 14px</Text>
<Text size="md">md · 16px</Text>
<Text size="lg">lg · 18px</Text>
<Text size="xl">xl · 20px</Text>
<Text size="2xl">2xl · 24px</Text>
<Text size="3xl">3xl · 30px</Text>
<Text size="4xl">4xl · 38px</Text>
<Text size="5xl">5xl · 48px</Text>
</Stack>
);
}Weights#
import { Stack, Text } from '@orkest/ui';
export function Example() {
return (
<Stack gap={1}>
<Text weight="regular">Regular 400</Text>
<Text weight="medium">Medium 500</Text>
<Text weight="semibold">Semibold 600</Text>
<Text weight="bold">Bold 700</Text>
</Stack>
);
}Shared options#
Centered muted text
import { Stack, Text } from '@orkest/ui';
export function Example() {
return (
<Stack gap={2}>
<Text lineHeight="relaxed" letterSpacing="wide">
Relaxed line height with wide tracking.
</Text>
<Text italic>Italic text is visual; use Strong for emphasis semantics.</Text>
<Text underline>Underlined text</Text>
<Text as="p" align="center" tone="muted">
Centered muted text
</Text>
</Stack>
);
}Overflow#
truncate limits text to one line. lineClamp limits it to a number of lines and takes precedence
when both props are set. Both options are visual; the full text remains in the DOM.
Single-line truncation keeps long copy from wrapping onto a second line.
Multi-line clamping stops after two lines and hides the remainder, which is useful for previews, cards, and feed summaries.
import { Box, Stack, Text } from '@orkest/ui';
export function Example() {
return (
<Box style={{ width: '22rem' }}>
<Stack gap={2}>
<Text as="p" truncate>
Single-line truncation keeps long copy from wrapping onto a second line.
</Text>
<Text as="p" lineClamp={2}>
Multi-line clamping stops after two lines and hides the remainder, which is useful for
previews, cards, and feed summaries.
</Text>
</Stack>
</Box>
);
}Semantic components#
Use strong, inline code, and links inside body copy.
import { Caption, Code, Label, Link, Small, Stack, Strong, Text } from '@orkest/ui';
import { Input } from '@orkest/ui/client';
export function Example() {
return (
<Stack gap={4}>
<Stack gap={1}>
<Label htmlFor="typography-project">Project name</Label>
<Input
id="typography-project"
type="text"
defaultValue="Orkest"
aria-describedby="typography-project-help"
/>
<Caption id="typography-project-help">Use a short name.</Caption>
</Stack>
<Text as="p">
Use <Strong>strong</Strong>, <Code>inline code</Code>, and{' '}
<Link href="/docs/components/text/">links</Link> inside body copy.
</Text>
<Small>Small text inherits the surrounding color.</Small>
</Stack>
);
}Component defaults#
Headingrendersh1–h6fromlevel(default2) with a level-driven size, semibold weight, tight line height, and tighter tracking.Paragraphrenderspatmdwith relaxed line height.Labelrenderslabelatsmwith medium weight.Captionrendersspanatxswith the muted tone.Smallrenderssmallatsmand inherits the surrounding color.Strongrendersstrongatinheritsize with semibold weight and inherited color.Coderenderscodeatinheritsize with the monospace face and a subtle token surface.Linkrendersaatinheritsize with the accent tone and a persistent underline.
Props#
These options are shared by every typography component. Each component supplies its own defaults.
| Prop | Type | Default |
|---|---|---|
size | '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | 'inherit' | — |
| Font size and matching line height. Defaults vary by component. | ||
weight | 'regular' | 'medium' | 'semibold' | 'bold' | — |
| Font weight token. Defaults vary by component. | ||
tone | 'default' | 'muted' | 'subtle' | 'inherit' | 'accent' | 'success' | 'danger' | — |
| Semantic text color. This is the color control for typography. | ||
align | 'start' | 'center' | 'end' | 'justify' | — |
| Text alignment. | ||
font | 'sans' | 'display' | 'mono' | 'numeric' | — |
| Font family. Numeric keeps Inter with tabular figures. | ||
lineHeight | 'tight' | 'snug' | 'normal' | 'relaxed' | — |
| Overrides the line height selected by the size. | ||
letterSpacing | 'tighter' | 'tight' | 'normal' | 'wide' | — |
| Overrides the letter spacing selected by the size. | ||
truncate | boolean | — |
| Single-line overflow with an ellipsis. The element switches to block layout so clipping works. | ||
lineClamp | number | — |
| Clamps text to the given number of lines. Takes precedence over truncate. | ||
italic | boolean | — |
| Applies italic styling. Use Strong for emphasis semantics. | ||
underline | boolean | — |
| Applies an underline with token-based thickness and offset. | ||
as | ElementType | — |
| Renders a custom element or component while keeping the typography styles. | ||
native attributes | ComponentPropsWithRef<T> | — |
| Inherited from the rendered element, including ref forwarding. | ||
| Prop | Type | Default |
|---|---|---|
Heading.level | 1 | 2 | 3 | 4 | 5 | 6 | 2 |
| Sets the rendered heading element and the default size. | ||
Heading.size | TextSize | — |
| Overrides the level-driven visual size without changing semantics. | ||
Label.htmlFor | string | — |
| Associates the label with a form control. | ||
Link.href | string | — |
| Native anchor destination. Use Button for actions instead. | ||
Accessibility#
Headingrenders a real heading element. Do not skip levels. Usesizeandasonly when the visual design or page structure requires decoupling.Paragraph,Label,Strong,Code, andLinkrenderp,label,strong,code, anda. Keep those semantics unless a different element is genuinely correct.- Associate
Labelwith its control throughhtmlForor by wrapping the control. Linkis for navigation. UseButtonfor actions, includingvariant="link".- Links use color and an underline, so meaning is not communicated by color alone.
- Truncation and line clamping are visual. The full text stays in the DOM; provide a title or another way to read critical content when necessary.
toneis semantic color, not a replacement for context. Pair status tones with text or an icon.
Related#
- Text for the underlying typography primitive and its full props.
- Typography foundations for font families, scale, and tokens.
- Button for actions styled as links.