Foundations
Radius
Five corner radius tokens and the components that use each one.
Deft has five radius tokens from 5px to 12px, plus rounded-full for pills and circles. The radius grows with the surface: a badge gets the smallest one, a dialog the largest.
Tokens
The tokens are declared as --radius-* variables in theme.css and replace Tailwind's values of the same names.
| Token | Utility | Value | Use |
|---|---|---|---|
--radius-xs | rounded-xs | 5px | Badge, Kbd, Button with size="xs" or size="inline", the focus ring of breadcrumb links and of sortable table headers. |
--radius-sm | rounded-sm | 6px | Button with size="sm" or size="md", Select and Combobox triggers, Input, Chip, Tag, Tabs tabs, menu, select and combobox items, sidebar items, table rows, Skeleton. |
--radius-md | rounded-md | 8px | Textarea, OTP input cells, Tooltip, Callout, Code, List items, the Tabs list, the panel of an expanded table row. |
--radius-lg | rounded-lg | 10px | Menu, Select, Combobox and Popover popups, Toast, List. |
--radius-xl | rounded-xl | 12px | Dialog, Panel, Metric card. |
| None | rounded-full | Full | Button with shape="pill", Action bar, Sidebar.Pill, Avatar, Dot, Switch, Step progress bars. |
Rules
- Take the radius from the component. Button sets it from
size, andshape="pill"switches it torounded-full. The exception is Skeleton, which isrounded-smby default: give it the radius of the thing it stands in for. - For your own surfaces, match the token of the nearest Deft surface:
rounded-smfor a row or a control,rounded-mdfor a block inside content,rounded-lgfor a floating popup,rounded-xlfor a panel. The dashboard uses only these utilities and has no arbitrary radius values. - Plain links get a 5px radius from the base styles, so their focus ring has rounded corners.
- Drawer has square corners: it fills the height of the viewport and touches its edge.
Nested corners
Menu and Tabs show how to nest rounded surfaces: the inner radius is the outer radius minus the padding between them.
- A Menu popup is
rounded-lgwith 4px of padding, and its items arerounded-sm. The outer 10px minus the 4px of padding gives the inner 6px. - The Tabs list is
rounded-mdwith 2px of padding, and each tab isrounded-sm: 8px minus 2px is 6px.
Keep the same arithmetic when you nest your own rounded surfaces.
Radius that changes with size or state
Avatar is a circle by default. With shape="square" its radius follows its size:
| Avatar size | Radius |
|---|---|
xs | 4px |
sm, md | rounded-xs, 5px |
lg | rounded-sm, 6px |
xl | rounded-lg, 10px |
An expanded table row keeps its top corners at rounded-sm and drops the bottom ones. The panel below it closes the shape with rounded-md bottom corners.
Values outside the scale
A few small marks use a fixed radius that is not a token:
| Element | Radius |
|---|---|
| Checkbox and the checkbox mark in Menu and Combobox items | 4px |
List.Icon with variant="tile" | 7px |
| Waterfall span bars | 3px |
Waterfall error markers, legend swatches of Meter.Parts | 2px |
These values are internal. Do not copy them into product code.