Text
Text is Brick's finished family for authored headings, paragraphs, inline copy, captions, supporting descriptions, and status copy. `Heading`, `Paragraph`, `Caption`, and `Eyebrow` provide common semantic defaults; `Text` keeps the selected HTML element independent from its visual recipe.
Built from the published package
Account settings
Manage the details used across your workspace.Last updated todayKnow when Text is the right part
Use it when
Use a named export for ordinary headings, paragraphs, captions, and editorial eyebrows. Use Text when a deliberate semantic host and visual recipe pairing falls outside those defaults.
Choose another path when
Use the owning component for Field labels, Dialog titles, Button labels, and other component anatomy. Use future Link, Code, Code Block, or List components for those distinct roles.
The family does not provide margins, content width, arbitrary font properties, automatic heading levels, language-aware title casing, live status behavior, editing, copying controls, or rich-text policy.
Installation and imports
Import from the root or stable subpath and load Brick styles once:
The complete stylesheet above is the recommended default. For a measured route-aware build, replace it with the shared foundation and this component's stylesheet:
Add the modular stylesheet for every other Brick component the route renders.
Do not combine modular styles with styles.css or tokens.css.
Public exports include Text, Heading, Paragraph, Caption, Eyebrow,
TextProps, HeadingProps, ParagraphProps, CaptionProps, EyebrowProps,
HeadingLevel, HeadingVariant, ParagraphVariant, TextElement,
TextVariant, TextTone, TextWeight, TextAlign, TextWrap,
TextTransform, and TextLineClamp.
Quick start
Heading level and variant are independent. Choose level 2 because it is
correct in the document hierarchy, not because of its visual size.
Visual recipes and states
displaypreserves Brick's original restrained product headline.display-sm,display-md, anddisplay-lgprovide an explicit authored display scale without coupling size to heading level.title-lg,title-md, andtitle-smcreate heading hierarchy.body-lg,body-md, andbody-smcover prose and supporting copy.captioncovers compact metadata without replacing accessible labels.eyebrowcovers a short uppercase editorial label placed before a heading; it is not body copy, status, or category semantics.transformchanges visual presentation without rewriting the authored DOM text. CSScapitalizeis not language-aware title case; author names and product titles with their correct casing instead.
Display/title recipes use the heading family, semibold weight, tight leading, and restrained negative tracking. Body/caption recipes use the body family, regular weight, and readable leading.
primary means normal high-emphasis text, not brand color. accent is the
brand-colored role. Secondary and muted reduce emphasis; info, success,
warning, and danger add semantic foreground color but never supply meaning
alone.
Use tone="inherit" when Text is intentionally nested in a parent component
such as Badge that owns its foreground and contrast pair. When two separately
meaningful inline Text nodes form one row, give them compatible typography
metrics and use HStack gap for their relationship instead of literal spaces
or positional offsets.
Text has no interactive state or motion.
Examples
Visual heading independent from semantic level
Section eyebrow
Eyebrow is a content role, not a generic small-text recipe. Use it only for a short label that introduces a nearby heading.
Supporting and status copy
Controlled overflow
The parent must provide the inline-size constraint.
API
Start with the public parts and root options below. Components with multiple parts separate each area into its own named subsection.
Core props
| Prop | Values | Default |
|---|---|---|
as | span, p, div, h1, h2, h3, h4, h5, h6 | span |
variant | display, display-sm, display-md, display-lg, title-lg, title-md, title-sm, body-lg, body-md, body-sm, caption, eyebrow; or a responsive value | body-md |
tone | inherit, primary, secondary, muted, accent, info, success, warning, danger | primary |
weight | inherit, regular, medium, semibold | recipe default |
align | start, center, end; or a responsive value | natural/start |
wrap | wrap, nowrap, balance, pretty | wrap |
transform | none, uppercase, lowercase, capitalize | variant recipe |
truncate | boolean | false |
lineClamp | 2, 3, 4, 5, 6 | none |
slot | string | text |
children | ReactNode | required |
truncate and lineClamp are mutually exclusive. slot controls the
component's data-slot hook; it is not forwarded as the native HTML slot
attribute. className, style, native global attributes, events, ARIA, and
data attributes pass to the selected host. The ref type is HTMLElement.
Named semantic exports
| Export | Native host | Visual variants | Default |
|---|---|---|---|
Heading | required level={1..6} | display, display-sm, display-md, display-lg, title-lg, title-md, title-sm; or a responsive value | title-lg |
Paragraph | p | body-lg, body-md, body-sm | body-md |
Caption | span | fixed | caption |
Eyebrow | span | fixed | eyebrow |
All four render through Text and add no wrapper. Use Text directly when a different valid host/recipe combination is intentional.
Accessibility
Choose heading levels from document structure and do not skip levels. Never
use a heading element merely to resize text. variant does not change the
accessibility tree.
Tone cannot be the only status cue. Preserve explicit status wording and any application-owned announcement behavior.
Text supports browser text resize, zoom/reflow, text-spacing overrides, selection, forced colors, localization, and RTL. If truncation or clamping hides essential information, provide the complete value through the application context; Text does not invent a tooltip or accessible alternative.
Responsive behavior
variant and logical align accept Brick's shared
{ initial, sm?, md?, lg?, xl? } shape. Use them when visual hierarchy or
alignment should adapt while the native host and heading level remain
unchanged:
Other typography inputs remain scalar. Text wraps naturally, allows long words to break, inherits direction, and imposes no fixed height, width, measure, or surrounding margin.
pretty is a progressive enhancement. Unsupported browsers retain readable
normal wrapping.
Styling and tokens
Customization
Use variant, tone, and weight first; semantic tokens for a theme; then Text variables or local CSS:
Arbitrary overrides make contrast, hierarchy, clipping, and reflow the consumer's responsibility.
Tokens and CSS hooks
Stable hooks:
Recipe metadata uses data-variant, responsive data-variant-sm|md|lg|xl,
data-tone, and, when applicable,
data-weight, data-align, data-transform, data-wrap, data-truncate, and
data-line-clamp.
Public Text variables:
--brick-text-font-family--brick-text-font-size--brick-text-font-weight--brick-text-line-height--brick-text-letter-spacing--brick-text-text-transform--brick-text-foreground
Each Text variant aliases the matching public semantic recipe:
--brick-typography-<variant>-font-family, font-size, font-weight,
line-height, and letter-spacing. Component-owned labels, descriptions,
titles, values, and controls consume anatomy or control recipes from the same
system without nesting Text. See
Appearance and tokens.
Advanced reference
Open these details only when you need to inspect DOM ownership, native forwarding, or lower-level composition.