Shadows
Shadows add depth and hierarchy to UI, expressing element elevation. Opacity is automatically adjusted in dark mode.
Shadow Scale
5-level elevation scale for various use cases — automatically adapts to dark mode
xssmmdlgxlxssmmdlgxlshadow-xsLv.1Subtle elevation
shadow-smLv.2Light elevation
shadow-mdLv.3Floating element
shadow-lgLv.4High elevation
shadow-xlLv.5Highest elevation
Light / Dark Comparison
In dark mode, opacity automatically increases for better visibility.
xssmmdlgxlxssmmdlgxlHover Elevation
Change shadows on hover to express interactivity
Hover over the card to see the effect
Component Shadows
Recommended shadow tokens for common UI components
Recommended shadow tokens: A reference for the optimal shadow token for each UI component.
Card
shadow-smLight elevation for cards
Dropdown
shadow-mdDropdown menus
Modal
shadow-lgModals, dialogs
Tooltip
shadow-smTooltips
Popover
shadow-mdPopovers
Dark Mode Notes
✓ Automatic Dark Mode Support
Shadow tokens define optimal opacity values per theme. They switch automatically via CSS variables — no component code changes required.
opacity: 0.05opacity: 0.1opacity: 0.1opacity: 0.1opacity: 0.1opacity: 0.2opacity: 0.3opacity: 0.3opacity: 0.3opacity: 0.3shadow-xsshadow-smshadow-mdshadow-lgshadow-xl| Token | Light | → | Dark | Ratio |
|---|---|---|---|---|
shadow-xs | 0.05 | → | 0.2 | 4× |
shadow-sm | 0.1 | → | 0.3 | 3× |
shadow-md | 0.1 / 0.06 | → | 0.3 / 0.2 | 3× |
shadow-lg | 0.1 / 0.05 | → | 0.3 / 0.2 | 3× |
shadow-xl | 0.1 / 0.1 | → | 0.3 / 0.25 | 3× |
Additional Dark Mode Techniques
Combined with shadows, these techniques make dark mode even more effective:
- ✓Use subtle borders to define boundaries
- ✓Lighten background of elevated elements (bg-elevated)
- ✓Combine shadows and borders to express depth