Text
The typography primitive for body copy — renders a <p> (or any element via
asChild). Ships without a line-length cap; add max-w-prose at the call
site for long-form prose. Size defaults to sm and accepts responsive
values: size={{ base: "sm", md: "lg" }}.
High-quality materials sourced from sustainable suppliers, each documented with finishes, dimensions, and availability.
Usage
import { Text, textSizeClasses } from "@desk/ui/components/text";Best practices
asis a closed text-only vocabulary — useas="span"for inline copy;as="div"/as="label"are type errors (useBoxfor wrappers,Labelfor form labels).asandasChildare mutually exclusive (asChildwins, dev-warned); Text ships without a line-length cap — addmax-w-proseat the call site for long-form prose.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| as | "li" | "p" | "span" | "dd" | "dt" | "figcaption" | "legend" | Render as a different host element from the closed text vocabulary
({@link TextElement}). The set is deliberately closed and text-only:
| |
| size | ResponsiveValue<"base" | "2xs" | "xs" | "sm" | "lg" | "xl" | "2xl" | "3xl"> | Text size — accepts a static size or responsive object like | |
| variant | "default" | "muted" | "accent" | Text color variant | |
| weight | "normal" | "medium" | "semibold" | Font weight | |
| asChild | boolean | Merge props onto child element using Slot |
Also exports
- const
textSizeClasses