Text
Body copy. Polymorphic — renders a p by default, or any element through as.
import { Text } from "antlitz";
API
| Prop | Type | Default |
|---|---|---|
| as | ElementType | — |
| asChild | boolean | false |
| size | "xs" | "sm" | "base" | "lg" | "xl" | "xxl" | "xxxl" | base |
| tone | "base" | "muted" | "subtle" | "danger" | base |
| weight | "normal" | "medium" | "semibold" | normal |
as accepts any element type, and the props type follows it: as="time"
accepts dateTime, as="label" accepts htmlFor.
Sizes
Extra small
Small
Base
Large
Extra large
2xl
3xl
export function Sizes() {
return (
<>
<Text size="xs">Extra small</Text>
<Text size="sm">Small</Text>
<Text size="base">Base</Text>
<Text size="lg">Large</Text>
<Text size="xl">Extra large</Text>
<Text size="xxl">2xl</Text>
<Text size="xxxl">3xl</Text>
</>
);
}Weights
Normal
Medium
Semibold
export function Weights() {
return (
<>
<Text weight="normal">Normal</Text>
<Text weight="medium">Medium</Text>
<Text weight="semibold">Semibold</Text>
</>
);
}Tones
Base
Muted
Subtle
Danger
export function Tones() {
return (
<>
<Text tone="base">Base</Text>
<Text tone="muted">Muted</Text>
<Text tone="subtle">Subtle</Text>
<Text tone="danger">Danger</Text>
</>
);
}danger exists for validation messages — it is the tone Field and Fieldset
use for errors.
Polymorphism
Published by Alihan.
export function Polymorphism() {
return (
<Text tone="muted">
Published{" "}
<Text asChild size="sm">
<time dateTime="2026-07-15">15 July 2026</time>
</Text>{" "}
by{" "}
<Text as="span" weight="semibold">
Alihan
</Text>
.
</Text>
);
}as changes the rendered element. asChild merges Text's styling onto a child
you supply, which is right when the child carries its own props or behaviour.
Long-form content
Text styles individual strings. For rendered markdown or CMS content — where every node arrives as a plain element — use the Typeset stylesheet instead.