Radius
Matrix is rounded but precise. Eight steps from a 2px corner to a full pill, chosen by the size of the element. Controls are 8px at every size; surfaces that hold them are 12px.
Usage
/* Radius is one property: border-radius, from a token. */
.panel {
border-radius: var(--rounded-lg);
}// The same steps as Tailwind utilities
<div className="rounded-lg border border-border bg-card" />shadcn components read --radius, which points at --rounded-md (8px), the control radius, so they pick up the Matrix default automatically.
Radius scale
| Token | Example | Value | Use |
|---|---|---|---|
| 2px | Tiny marks under 16px: status dots in a row, mini swatches, progress segments. | ||
| 4px | Checkboxes, inline code, keyboard keys, small counters. | ||
| 6px | Small tags and badges around 24px tall. | ||
| 8px | Every control, at any size: buttons, inputs, selects, menu items, swatches. Also tooltips. | ||
| 12px | Surfaces that hold controls: menus, popovers, small cards. | ||
| 16px | Brand cards and panels. | ||
| 24px | Dialogs, sheets and large feature surfaces.Provisional | ||
| 9999px | Pills: avatars, switches, chips. |
Click a token or class to copy it.
Radius follows size
| Element height | Example | Radius | For |
|---|---|---|---|
| Under 16px | Status dot, mini swatch | ||
| ~20px | Checkbox, counter, tag | ||
| ~36px | Controls at any size: button, input, select, menu item | ||
| ~64px | Menu, popover, small card | ||
| ~96px | Card, panel |
A corner has to fit the element it rounds. The same 8px that looks right on a 36px button turns a 14px chip into a pill, and a 4px corner looks sharp on a large card. Before you pick a radius, check the height of the container and use the step next to it in the table. Between two rows, pick the smaller radius.
Nested corners
When a rounded surface sits inside another, the inner corner is the outer corner minus the gap between them. A 16px card with 8px padding holds 8px items. Matching radii make the inner corners look too round.
Guidelines
- Use a token, never a hand-written
border-radiusor an arbitraryrounded-[10px]. - Always consider the size of the container before picking a radius: small elements get small corners, large surfaces get larger ones.
- Controls (buttons, inputs, selects) are
md(8px) at every size, so a row of them reads as one family. Their containers step up:lgfor menus and popovers,xlfor cards. - Nest corners: inner radius = outer radius − padding.
- Use
fullonly for pills and circles, never for rectangular buttons or cards. - Don't mix radii on one surface (a rounded top with square bottom corners), except where it's attached to an edge.
- Don't round data tables or full-width bars; square edges read as structure.