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

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

Format
Plain text
Encoding
UTF-8
Example document with a long descriptive name.txt24 KB

API#WIP

leveldefault: 1
1 | 2 | 3 | 4 | 5 | 6
Semantic 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.
render
ReactElement | (props) => ReactElement
Base UI render override for changing the underlying element.
...props
useRender.ComponentProps<"h1">
Native heading attributes plus Base UI render composition props.
sizedefault: "body"
"large" | "body" | "small" | "caption"
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.
render
ReactElement | (props) => ReactElement
Base UI render override for changing the underlying element.
...props
useRender.ComponentProps<"p">
Native paragraph attributes plus Base UI render composition props.
sizedefault: "code"
"code" | "meta" | "eyebrow" | "tabular"
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.
render
ReactElement | (props) => ReactElement
Base UI render override for changing the underlying element.
...props
useRender.ComponentProps<"p">
Native paragraph attributes plus Base UI render composition props.