Search
Search pages, pieces and blocks.
Corners
Three radii do the work: 4 for marks, 6 for controls and rows, 12 for anything that holds them. When one sits close inside another, the outer corner is the inner corner plus the padding.
- Working
- 4, 6, 12
- Tokens
- 10 plus full
- Nesting
- outer = inner + pad
In a real piece
A menu, a field row and a card, as shipped. The tags are read from the computed corner. Hover one.
Every radius in the code
From globals.css. Uses count rounded classes in src/components and src/app. Click a token to copy.
| Corner | Token | px | Where | Note | Uses |
|---|---|---|---|---|---|
| 2 | Chart bars, input group addons, link focus | 9 | |||
| 4 | Marks: Checkbox, Kbd, Switch knob, tooltip | 24 | |||
| 5 | Slider and Image Compare thumbs | 5 | |||
| 6 | Rows, menu items, tabs, chips, sidebar items | 116 | |||
| 6 | Button, Input, Button Group, Toggle Group | Reads --radius, the same as md | 105 | ||
| 6 | The site shell's panel | Reads --radius | 1 | ||
| 12 | Card, Dialog, menus, Command, Lightbox | 69 | |||
| 16 | Library miniatures only | Not in components/ui | 1 | ||
| 20 | Nothing | Unused | 0 | ||
| 24 | Nothing | Unused | 0 | ||
| infinite | Avatar, Radio, Slider track, dots | 49 |
Nesting
The rule only bites when the gap is small, as in menus, segmented controls and grouped buttons.
6 outside, 4 inside, 2 between. Menubar, rounded-lg p-0.5 around rounded-sm triggers. 6 = 4 + 2.
12 = 6 + 6. Menu, rounded-xl p-1.5, around a rounded-md row. The two curves run parallel.
12 inside 12. The inner curve is too round for the gap, so the corner pinches.
Past 8, it stops mattering. A card's p-5 is wide enough that a 6 field inside it reads on its own.
Do and don't
In the code
- a--radius-md, --radius-lg and --radius-panel all read --radius. Button and Input (rounded-lg) and rows (rounded-md) are still one corner under two names.
- b--radius: 0.375rem is the one source. Change it and md, lg, panel, xl and 4xl follow.
- cSmall controls clamp with rounded-[min(var(--radius-md),10px)] and 12px, 10 places: Button xs and sm, Toggle, Toggle Group, Select, Native Select and the header tabs. Both resolve to 6, so the clamp does nothing today.
- d--radius-3xl and --radius-4xl have no uses. 2xl appears only in the Library miniatures.
Rules
- 1Pick by job: 4 for a mark, 6 for a control or a row, 12 for a container.
- 2Close nesting adds up: outer equals inner plus padding. A 6 padded menu around 6 rows is 12.
- 3Full is for things that are round by nature: avatars, radios, dots, tracks. Never a button.
- 4Do not add a radius. If 4, 6 and 12 do not fit, the piece is in the wrong family.