Typography
Semantic text components covering headings, body, caption, and code styles from the type scale.
Examples
Display
Hero-scale display heading using the display font family.
Build beautiful interfaces
Heading
Section headings at h2, h3, and h4 scale.
Body
Paragraph text at base and small sizes.
Caption
Small caption and label text styles.
Code
Inline code and monospaced text styles.
Full hierarchy
All type levels together to illustrate the complete scale.
Installation
pnpm add @rokle/components @rokle/tokensInstalls with the default Rokle brand. Generate a custom brand on rokle.app to use your own colours and personality.
Usage
import { Typography } from "@rokle/components";import { Typography } from "@rokle/components";
export function Example() {
return <Typography />;
}API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | "h1" | "h2" | "h3" | "h4" | "body" | "caption" | "code" | "body" | Type scale variant. |
| children | ReactNode | - | Text content. |
| className | string | - | Additional CSS classes. |