Shadows
Elevation scale
Six steps, shadow-1 to shadow-6. shadow-1 is a thin inset rim; 2 to 6 get larger and softer. Dark mode uses higher alpha so the shadows still show on a near-black canvas.
shadow-1shadow-2shadow-3shadow-4shadow-5shadow-6| Token | Light | Dark |
|---|---|---|
shadow-1--shadow-1 | inset 0 0 0 1px rgb(0 0 0 / 0.06) | inset 0 0 0 1px rgb(255 255 255 / 0.06) |
shadow-2--shadow-2 | 0 1px 2px rgb(0 0 0 / 0.08), 0 1px 1px rgb(0 0 0 / 0.06) | 0 1px 2px rgb(0 0 0 / 0.4), 0 1px 1px rgb(0 0 0 / 0.3) |
shadow-3--shadow-3 | 0 2px 4px -1px rgb(0 0 0 / 0.1), 0 4px 8px -2px rgb(0 0 0 / 0.08) | 0 2px 4px -1px rgb(0 0 0 / 0.5), 0 4px 8px -2px rgb(0 0 0 / 0.4) |
shadow-4--shadow-4 | 0 8px 16px -4px rgb(0 0 0 / 0.12), 0 2px 4px -2px rgb(0 0 0 / 0.08) | 0 8px 16px -4px rgb(0 0 0 / 0.55), 0 2px 4px -2px rgb(0 0 0 / 0.4) |
shadow-5--shadow-5 | 0 12px 32px -8px rgb(0 0 0 / 0.18), 0 4px 8px -4px rgb(0 0 0 / 0.1) | 0 12px 32px -8px rgb(0 0 0 / 0.6), 0 4px 8px -4px rgb(0 0 0 / 0.45) |
shadow-6--shadow-6 | 0 24px 48px -12px rgb(0 0 0 / 0.24), 0 8px 16px -8px rgb(0 0 0 / 0.12) | 0 24px 48px -12px rgb(0 0 0 / 0.7), 0 8px 16px -8px rgb(0 0 0 / 0.5) |
Semantic roles
Components use three role tokens instead of picking a step. Two of them point at the scale, so they follow the light and dark values above.
shadow-cardResting surfaces that sit on the page. Card itself has no resting shadow; it uses a border.
shadow-panelFloating surfaces that open near their trigger. Also the hover shadow on an interactive Card.
shadow-modalBlocking overlays that sit above the rest of the page.
| Token | Light | Dark |
|---|---|---|
shadow-card--shadow-card | var(--shadow-2) | var(--shadow-2) |
shadow-panel--shadow-panel | var(--shadow-4) | var(--shadow-4) |
shadow-modal--shadow-modal | 0 20px 60px -15px rgb(0 0 0 / 0.35) | 0 20px 60px -15px rgb(0 0 0 / 0.6) |
Usage
Floating panels
Use shadow-panel on surfaces that open near a trigger and close on an outside click. Add data-panel so the surface gets the elevated fill (and the blur when translucent panels are on).
<div data-panel className="shadow-panel rounded-[var(--radius-panel)] border border-hairline">
{children}
</div>Modals
Use shadow-modal on content that blocks the rest of the page, such as a dialog.
<div data-panel className="shadow-modal rounded-[var(--radius-panel)] border border-hairline">
{children}
</div>Changing the values
All nine tokens are CSS custom properties in global.css, set for light and dark. Override them in your own stylesheet. Pointing a role at another step keeps the light and dark values in sync:
/* Raise floating panels one step and keep modals on the scale */
:root,
.dark {
--shadow-panel: var(--shadow-5);
--shadow-modal: var(--shadow-6);
}