Shadows
Utilities for controlling box shadows with theme integration.Import
API
Fromshadows/shadows.js:3-8:
Basic Usage
Use numeric values to reference theme shadows:Theme Shadows
The default theme provides 25 shadow levels (0-24):Shadow Levels
Custom Shadow Values
You can also pass custom shadow values:Common Patterns
Card with Shadow
Elevated Paper
Hover Elevation
Floating Action Button
Modal Dialog
Tooltip
App Bar
Card Grid
Responsive Shadows
Inner Shadow
Create inset shadows with custom values:Multiple Shadows
Colored Shadows
Conditional Shadows
Custom Theme Shadows
Customize the shadow scale:TypeScript
Dark Mode Shadows
Performance
Shadows can impact performance. For better performance:Available Properties
| Prop | CSS Property | Theme Key | Values |
|---|---|---|---|
boxShadow | box-shadow | shadows | 0-24 or custom shadow value |
Shadow Elevation Guide
- 0 - No elevation
- 1 - Subtle, for resting state of cards
- 2 - Low elevation, for cards
- 3 - Slightly raised cards
- 4 - App bar elevation
- 6 - Floating action button (resting)
- 8 - Floating action button (raised)
- 12 - Dialogs
- 16 - Navigation drawer
- 24 - Modal overlays
Related
- Box Component - Using shadows with Box
- Borders - Border utilities
- sx Prop - Advanced shadow styling