Text

Semantic text primitives for headings, product copy, and compact metadata.

Preview#

Workspace updates

3 unread messages

raft-ui@0.0.1

import { Text } from "raft-ui";

<Text.Heading />
<Text.Sans />
<Text.Mono />

Sizes#

Use Text for repeatable product typography. Use token pages when auditing the full type scale.

Heading level 5

Large body

Body text

Small supporting text

Caption text

meta

Variants#

Default

Muted

Placeholder

Primary

Success

Danger

Semantic elements#

Use the render prop to preserve Text styling while choosing the element required by the surrounding document structure.

Format
Plain text
Encoding
UTF-8

Inline list-row typography#

Example document with a long descriptive name.txt24 KB

API#WIP

PropTypeDefaultDescription
level1 | 2 | 3 | 4 | 5 | 61Semantic heading level. Renders the matching h1–h6 element.
variant"default" | "primary" | "information" | "muted" | "placeholder" | "accent" | "success" | "warning" | "danger"Optional semantic color. Leave unset for the strong heading default.
renderReactElement | (props) => ReactElementBase UI render override for changing the underlying element.
...propsuseRender.ComponentProps<"h1">Native heading attributes plus Base UI render composition props.
PropTypeDefaultDescription
size"large" | "body" | "small" | "caption""body"Sans text size for product copy and supporting labels.
variant"default" | "primary" | "information" | "muted" | "placeholder" | "accent" | "success" | "warning" | "danger"Optional semantic color. Leave unset to use the size recipe default.
renderReactElement | (props) => ReactElementBase UI render override for changing the underlying element.
...propsuseRender.ComponentProps<"p">Native paragraph attributes plus Base UI render composition props.
PropTypeDefaultDescription
size"code" | "meta" | "eyebrow" | "tabular""code"Mono text size for identifiers, metadata, and numeric text.
variant"default" | "primary" | "information" | "muted" | "placeholder" | "accent" | "success" | "warning" | "danger"Optional semantic color. Leave unset to use the size recipe default.
renderReactElement | (props) => ReactElementBase UI render override for changing the underlying element.
...propsuseRender.ComponentProps<"p">Native paragraph attributes plus Base UI render composition props.