Typography
Use the typography components for the text you write in JSX, such as headings, body text, links, quotes, lists and keycaps, so it follows the type scale and the theme. To render Markdown you get at runtime, use Markdown, which renders with these components; to cut long text to one line or a few, use Ellipsis.
Put each ListItem inside a List: it renders an li.
The typography components set prose and labels in the global type scale: headings, inline text, paragraphs, links, quotes, lists, separators, keycaps and eyebrow labels. Each one sets its own size, color and spacing from theme tokens, so text built from them reads the same in light and dark mode, wherever it is placed.
import {
Blockquote,
Eyebrow,
Heading,
Kbd,
Link,
List,
ListItem,
Paragraph,
Separator,
Text,
} from "@pika-lab/react";Block components (Heading, Paragraph, Blockquote, List, Separator) carry their own vertical margins and drop them at the start and end of their container. Inline components (Text, Link, Kbd, Eyebrow) have none.
#Heading
Heading renders a section heading, h1 to h6. Its size comes only from level, taken from the global type scale, and it carries its own vertical margins.
#Basic
level picks the element and its size: h1 24px, h2 20px, h3 18px, h4 to h6 16px. The default is 2.
Release notes
Version 2.4
New components
Heading
Props
Accessibility
#Prefix bar
prefix="bar" draws a bar before the text. type colors the bar: default, primary, info, success, warning or error. The text keeps the primary label color.
default
primary
info
success
warning
error
#Align text
With alignText, the bar moves into the left gutter so the heading text lines up with the body text below it.
Without alignText
The bar pushes the heading text right of the body text.
With alignText
The bar sits in the gutter and the text lines up with this paragraph.
#Spacing
A heading has a margin above and below it, larger for h1 to h3. The first child of its container drops its top margin and the last child its bottom margin.
Install
Add the package and import its styles once at the root of the app.
Peer dependencies
React 19 or later. Nothing else is required.
Fonts
Pika names font families but never loads font files.
#Anchor
id and other attributes go to the heading element, so a link can point at it.
Usage #
Copy the link next to the heading to share this section.
#Props
| Name | Type | Default | Description | Version |
|---|---|---|---|---|
level | 1 | 2 | 3 | 4 | 5 | 6 | 2 | Renders h1 to h6, and sets the size. | Unreleased |
prefix | bar | undefined | bar draws a bar before the text. | Unreleased |
type | default | primary | info | success | warning | error | default | The bar’s color. | Unreleased |
alignText | boolean | false | With prefix="bar", moves the bar into the left gutter so the text lines up with the body. | Unreleased |
Other h1 attributes (id, className, aria-*, ref …) go to the heading element.
Pass level to pick the heading. Sizes follow the Pika type scale, so h1 is 24px; use a display size of your own for a hero title.
#Text
Text renders a run of text in the body size (--p-font-size-4 / --p-line-height-4). It always sets its own color, the primary label color unless type or depth says otherwise, so it reads the same wherever it is placed. There is no size prop.
#Type
type picks a color role: default, primary, info, success, warning or error.
#Depth
depth steps the default color down to the secondary and tertiary label colors. It only applies when type is default.
#Strong, italic, underline, delete
delete wraps the content in <del>, so assistive tech announces it as removed.
#Code
code renders the content as inline code in <code>. It keeps the color of type and depth, and combines with delete.
pnpm check before you open a pull request.useLegacyTheme was removed; the call now fails with ERR_THEME.#Element
as picks the element, from a fixed set of text elements. The element’s meaning stays; its size and color come from Text.
A paragraph rendered by Text.
Emphasis keeps its meaning for screen readers.Small print, still in the body size.#Props
| Name | Type | Default | Description | Version |
|---|---|---|---|---|
as | TextElement | span | The element to render: span, div, p, label, strong, em, b, i, small, time, abbr, cite, q, mark, sub, sup, dfn, legend, figcaption, dt or dd. | Unreleased |
code | boolean | false | Renders the content as inline code. | Unreleased |
delete | boolean | false | Strikes the content through with <del>. | Unreleased |
depth | 1 | 2 | 3 | undefined | Primary, secondary or tertiary label color. Only with type="default". | Unreleased |
italic | boolean | false | Italic text. | Unreleased |
strong | boolean | false | The theme’s strong weight. | Unreleased |
type | default | primary | info | success | warning | error | default | Color role. | Unreleased |
underline | boolean | false | Underlined text. | Unreleased |
Other props, including ref, go to the root element, which is always the as element. <code> or <del> sit inside it, so as and the type of ref always match.
#Paragraph
Paragraph renders a <p> of prose: the body font size (step 4 of the type scale) with the prose line height, --p-line-height-prose (1.6), rather than the fixed 20px line height of dense UI text.
#Basic
Paragraphs keep 16px above and below. The first paragraph in its container has no space above and the last has none below.
A paragraph is a block of prose. It uses the body font size with a roomy line height, so longer passages stay easy to read.
Paragraphs keep 16px of space above and below. The first one in its container drops the space above and the last one drops the space below, so a group of paragraphs sits flush with whatever wraps it.
#Depth
depth sets the text emphasis: 1 is the primary text color and the default, 2 and 3 are quieter.
Depth 1: the primary text color, used by default.
Depth 2: secondary text, for supporting detail.
Depth 3: tertiary text, for hints and fine print.
#Props
| Name | Type | Default | Description | Version |
|---|---|---|---|---|
depth | 1 | 2 | 3 | 1 | Text emphasis: primary, secondary or tertiary label color. | Unreleased |
Other props, including ref, go to the <p>. A paragraph without depth uses the primary text color.
#Link
Link is an inline link inside text. It keeps the font and size of the text around it, takes its color from type, and lets the theme decide the underline.
#Basic
A link reads as part of the sentence: only its color and underline change.
Every component reads its colors from the color roles, and text sizes come from the typography scale, so a link takes the size of the sentence around it.
#Type
primary is the brand link color. neutral is a quiet gray link for meta lines and footers, where a colored link would be too loud.
#Underline
auto underlines on hover only. hover, always and none set the underline explicitly.
#Highlight
variant marks a link the way a reading app marks a highlight: marker lays a soft, light band across the lower third of the text (it fills the line on hover), wave and line draw a wavy or straight stroke under it. color picks yellow (default), blue, green or pink. Marked links keep body-text ink, tinted toward the band for marker, and a link that wraps keeps its mark on every line.
marker yellow · marker blue · marker green · marker pink
wave yellow · wave blue · wave green · wave pink
line yellow · line blue · line green · line pink
A marked link that wraps keeps its mark on every line: the color system explains how the jade seed turns into every role in the library.
#External links
target="_blank" adds rel="noopener noreferrer"; tokens you pass in rel are kept.
#Router links
as renders another component instead of <a>, such as your router’s link. Link accepts that component’s props (here to) and passes its class, rel and ref on, so the component must render an <a> that takes them. To route in-app <Link href="/…"> links across an entire app (including internal links rendered by Markdown), set componentOptions={{ Link: { as: RouterLink } }} on ConfigProvider; external/scheme URLs (https:, mailto:, //…), #hash anchors, download, and target="_blank" automatically fall back to a native <a>.
Read the getting started guide first.
#Props
| Name | Type | Default | Description | Version |
|---|---|---|---|---|
as | ElementType | 'a' | The element or component to render, e.g. a router’s Link. | Unreleased |
type | primary | neutral | primary | Color role. | Unreleased |
underline | auto | hover | always | none | auto | When the underline shows; auto follows the theme. | Unreleased |
variant | plain | marker | wave | line | plain | How the link is marked; see Highlight. | Unreleased |
color | yellow | blue | green | pink | yellow | The mark’s color when variant is not plain. | Unreleased |
Other props go to the rendered element. type is the color role, so the anchor’s own type attribute is not available. as, type, underline, variant and color defaults can be set for a subtree with ConfigProvider’s componentOptions={{ Link: { … } }}.
A visited link keeps its type’s color.
#Blockquote
Blockquote renders a <blockquote> with a bar on its left, in secondary text. Like the other typography components it carries its own vertical margins and drops them at the start and end of its container.
#Basic
cite and the other native attributes pass through to the <blockquote>.
Cool URIs don't change.
#Paragraphs
Paragraphs inside a quote sit closer together than on the page, and the first and last lose their outer margins so the bar fits the text.
Make each program do one thing well.
Expect the output of every program to become the input to another, as yet unknown, program.
#Align text
alignText hangs the bar and its gap in the left gutter, so the quoted text lines up with the text around it.
The release notes put it plainly:
Nothing in this release changes the public API.
So upgrading should be a no-op.
#Nested
A quote inside a quote gets its own bar.
Agreed, with one change:
Ship the token PR first, then the components on top of it.Components can go in parallel after that.
#Props
| Name | Type | Default | Description | Version |
|---|---|---|---|---|
alignText | boolean | false | Hangs the bar in the left gutter so the text lines up with the surrounding text. | Unreleased |
Every other <blockquote> attribute, including cite and ref, passes through. The text color is fixed to the secondary label color. A thin neutral bar runs down its start edge.
#List
List renders a prose list: a <ul>, or an <ol> when ordered. Each ListItem is an <li>; put another List inside an item to nest. The list carries its own vertical margin, dropped when it is the first or last thing in its container, and each item after the first sits a little below the one before.
This is the typography list. For long feeds, use VirtualList, which renders only the rows in view.
#Basic
Bullets by default, numbers with ordered. Markers stay quiet in the tertiary label color.
- Channels group conversations by topic
- Threads keep replies next to the message
- Agents can join any channel you invite them to
- Create a workspace
- Invite your team
- Add your first agent
#Ordered
start sets the first number, reversed counts down and type picks the numbering (1, a, A, i, I). All three go to the <ol> and only apply with ordered.
- Run the migrations
- Restart the workers
- Watch the error rate
- Bronze
- Silver
- Gold
- Draft
- Review
- Publish
#Nested
A List inside a ListItem is a sub-list. Nested bullet lists switch to a second bullet style.
- Inbox
- Mentions
- Threads
- Following
- Muted
- Saved
- Set up the server
- Pick a region
- Add a domain
- Connect a machine
- Install the runtime
- Paste the token
#Align text
alignText removes the indent: the markers hang in the left gutter and the item text lines up with the text around the list.
Indented (default):
- Markers sit inside the text column
- Item text is indented by 2em
With alignText:
- Markers hang in the gutter
- Item text lines up with this paragraph
#Task list
A task item drops its marker so the leading checkbox stands in for it, as in a GFM task list (- [x] …). An item whose first child is a checkbox (a native <input type="checkbox"> or a Checkbox) does this on its own in browsers with :has(); task does it explicitly, and also works when the checkbox is wrapped.
#Props
| Name | Type | Default | Description | Version |
|---|---|---|---|---|
ordered | boolean | false | Renders an <ol> instead of a <ul>. | Unreleased |
start | number | undefined | The number of the first item. Only with ordered. | Unreleased |
reversed | boolean | undefined | Counts down. Only with ordered. | Unreleased |
type | 1 | a | A | i | I | undefined | Numbering style. Only with ordered. | Unreleased |
alignText | boolean | false | Hangs the markers in the gutter so the item text aligns with the surrounding text. | Unreleased |
Other props go to the <ul> / <ol>.
#ListItem Props
| Name | Type | Default | Description | Version |
|---|---|---|---|---|
task | boolean | false | Drops the marker so a leading checkbox replaces it. | Unreleased |
Other props, such as value, go to the <li>.
#Theme tokens
| Token | Default |
|---|---|
--p-list-font-size / --p-list-line-height | --p-font-size-4 / --p-line-height-4 |
--p-list-margin | 16px 0 |
--p-list-padding | 2em |
--p-list-item-margin | 0.25em 0 0 |
--p-list-bullet-type / --p-list-nested-bullet-type | disc / circle |
--p-list-marker-font-weight | regular |
--p-list-marker-color | initial (tertiary label) |
#Separator
Separator draws a line between content: a rule between blocks, a rule with a label in it, or a short vertical rule between inline items.
#Basic
With no children it renders an <hr> with space above and below. As the first or last child of its container it drops that outer space.
Release notes are written as each change lands.
Breaking changes are listed first, then fixes.
#Label
Children put a label in the line. labelPlacement moves it to the left, center or right. The label also names the separator for assistive tech.
#Dashed
#Vertical
orientation="vertical" renders an inline line, 1em tall, between inline items.
#Decorative
decorative marks a line as purely visual: it gets role="none" and is hidden from assistive tech. A label stays readable as plain text.
The card header already separates this section.
So the line below it is only visual.
#Props
| Name | Type | Default | Description | Version |
|---|---|---|---|---|
children | ReactNode | undefined | A label in the line. Ignored when vertical. | Unreleased |
dashed | boolean | false | Draws the line dashed. | Unreleased |
decorative | boolean | false | Purely visual: no separator role. | Unreleased |
labelPlacement | left | center | right | center | Where the label sits on the line. | Unreleased |
orientation | horizontal | vertical | horizontal | A block rule or an inline rule. | Unreleased |
Other props go to the root element: <hr>, the labeled <div role="separator">, or the vertical <span role="separator">.
#Kbd
Kbd marks up keyboard input as a keycap, using the native <kbd> element. It is sized in em, so it follows the text it sits in.
#Basic
Put the key’s label inside.
Press Esc to close the dialog, or Enter to confirm.
#Key combinations
keys renders one keycap per key, joined by separator (+ by default). As the HTML spec suggests for combinations, the keycaps are wrapped in an outer <kbd>.
Open search with ⌘+K
Save as with Ctrl+Shift+S
Go to inbox with GthenI
#Size
medium is 0.875em of the surrounding text and small is 0.75em, so keycaps scale with headings and captions alike.
Medium ⌘+C and small ⌘+C
In larger text the keycaps grow with it ⌘+C
#Modifier symbols
Kbd does not detect the platform or map key names. Write the symbol you want, and give symbols a title so the name shows on hover.
#Props
| Name | Type | Default | Description | Version |
|---|---|---|---|---|
children | ReactNode | undefined | The key’s label. Ignored when keys is set. | Unreleased |
keys | readonly ReactNode[] | undefined | Renders a combination: one keycap per entry inside an outer <kbd>. | Unreleased |
separator | ReactNode | "+" | What goes between the keys of a combination. | Unreleased |
size | small | medium | medium | Relative to the surrounding text: 0.75em or 0.875em. | Unreleased |
Kbd also accepts native kbd attributes and a ref, which go to the outer element of a combination.
#Eyebrow
Eyebrow is the small label above or beside a section: a list group, a panel block, a form field. It is bold, uppercase and widely spaced, always in the secondary label color, so every section label reads the same wherever it sits. Chinese text renders as is.
#Basic
12px, the strong weight and the widest letter spacing. The color is set, not inherited.
#Mono
mono switches to the monospace meta voice, one step smaller at 11px, for runtime details, versions and counters.
#Section heading
When the eyebrow is the only title of a section, render it as a heading with as="h2" to "h6" so it shows up in the document outline. It looks the same; browser heading margins are reset.
Members
- Kate
- Kirby
- Wug
#Form label
With as="label" and htmlFor, the eyebrow labels a form control.
#Before and after
before and after put an icon or a count next to the label. Counts use tabular figures.
#Props
| Name | Type | Default | Description | Version |
|---|---|---|---|---|
as | span | div | label | h2 | h3 | h4 | h5 | h6 | span | The element to render. div and headings are blocks; span and label are inline. | Unreleased |
htmlFor | string | undefined | The id of the control the label belongs to. Only used with as="label". | Unreleased |
mono | boolean | false | Monospace at 11px instead of the sans face at 12px. | Unreleased |
before | ReactNode | undefined | Content before the label, such as an icon. | Unreleased |
after | ReactNode | undefined | Content after the label, such as a count. | Unreleased |
children | ReactNode | undefined | The label text. | Unreleased |
Eyebrow also accepts native attributes and a ref. It has no margins; space it from the layout around it. Decorative icons in before should carry aria-hidden.