Radius and elevation
Components: Button, Input, Select, Card, CardContent, Tag, Tooltip, Avatar
+20 more
DropdownMenu, Popover, PopoverTrigger, PopoverContent, Drawer, Dialog, SearchModal, Alert, Table, Toast, ChatInput, Checkbox, Radio, Switch, Kbd, NavRail, SegmentedControl, Skeleton, InputGroup, SplitButton
Radius utilities are named in pixels. Shadows are named by size and do not change in dark mode.
What you use
Rules
- Read
rounded-*numbers as pixels. If a value is off the scale, round to the nearest step. - Never use Tailwind's named radii (
rounded-xs…rounded-4xl) or barerounded. They compile to rem defaults off the scale. - Never write an arbitrary radius or shadow such as
rounded-[15px]orshadow-[0_2px_4px_rgba(0,0,0,0.1)]. - If your element sits next to a design-system component, copy that component's radius. A custom button-sized element next to
Buttongetsrounded-8. - If you nest a rounded element inside a padded rounded container, use a smaller inner radius:
rounded-12outside, 4px padding,rounded-8inside. - If you round only some corners, use side or corner variants of the same step:
rounded-t-12,rounded-tl-12. - If an element stays in the page flow, give it no shadow.
Cardis the one in-flow surface with a shadow (shadow-sm). - If an element floats, use the shadow for its layer below.
- If you add a shadow to your own floating element, pair it with
border border-border-primary-lightand a surface fill such asbg-bg-surface-2. They carry the depth in dark mode. - Never add
shadow-*toCard,Input,Buttonor another design-system component. They own their shadow. - Never add a dark-mode shadow (
dark:shadow-lg) or useshadow-2xl. - Never use a shadow as a focus indicator. See Focus.
There is no --elevation-* token, no shadow-card/shadow-popover/shadow-modal utility, and no dark-mode shadow value.
Examples
A placeholder takes its corners from the rounded prop.
A custom floating element pairs its shadow with a border and fill.
A nested item steps the radius down.
Reference
Radius scale
Skeleton rounded accepts 'none', 'full', 2, 4, 6, 8, 10, 12, 16, 24, 32.
Elevation scale
See Spacing for padding inside rounded surfaces.