Component docs
Loading
import { Text } from "@pixxl-tools/components";
// In Server Components:
import { Text } from "@pixxl-tools/components/server";| Prop | Type | Default | Description |
|---|---|---|---|
measure | boolean | false | Cap the line length at the reading measure (--pixxl-prose-measure, default --pixxl-size-prose, 68ch) like Prose text (default false). For running text outside Prose: site paragraphs, intros, descriptions. |
size | TextSize | md | Type size (default md). |
tone | TextTone | neutral | Text colour role (default neutral). |
truncate | boolean | — | Single line with an ellipsis. |
as | TextElement | p | Element to render (default p). |
measuredefault falseboolean
Cap the line length at the reading measure (--pixxl-prose-measure, default --pixxl-size-prose, 68ch) like Prose text (default false). For running text outside Prose: site paragraphs, intros, descriptions.
sizedefault mdTextSize
Type size (default md).
tonedefault neutralTextTone
Text colour role (default neutral).
truncateboolean
Single line with an ellipsis.
asdefault pTextElement
Element to render (default p).
Other props are passed to the root element (HTMLAttributes<HTMLElement>), including className, style, id and aria-* attributes.
Readable text changes with props
Complex object props use fixed fixtures. Primitive props stay editable.
<Text size="md" tone="neutral" truncate={false} measure={false}>Readable text</Text>Readable text
<Text>Readable text</Text>Readable text changes with props
<Text size="md" tone="neutral" truncate={false} measure={false}>Readable text</Text>