Outer Shadow Sizes
Outer shadows lift an element visually off the background. Use lighter shadows for dense UI components and heavier shadows for focal points and overlapping surfaces.Colored Outer Shadows
Color shadow presets use the same geometry asshadow-md but tint the shadow with a semantic color. Use them to reinforce meaning alongside status indicators, alerts, or branded elements.
Inset Shadow Sizes
Inset shadows reverse the depth direction, making an element look recessed into the page rather than lifted off it. They’re ideal for input fields, search bars, and any control that should appear sunken or pressed.Colored Inset Shadows
Colored inset shadows apply semantic tinting to theinset-shadow-md geometry. Use them to highlight the current state of interactive controls.
Best Practices
- Start lighter than you think you need.
shadow-smandshadow-mdhandle the majority of card and container use cases. Reserveshadow-xlandshadow-panelfor elements that genuinely need to float above the rest of the layout. - Match shadow weight to element size. Small, dense components like inputs and tags look best with
shadow-sm. Large, standalone panels suitshadow-xlorshadow-panel. - Use inset shadows for interactive depth. If a component accepts input or has a pressed state, an inset shadow reinforces that affordance more clearly than a flat background alone.
- Use colored shadows sparingly. A
shadow-erroron a validation field is effective because it’s rare. If every card hasshadow-primary, the semantic meaning is lost. - Never stack size and color shadow classes. Each class is a complete preset. Applying both
shadow-mdandshadow-primaryto the same element will not produce a mid-sized primary-colored shadow — one will override the other.
Related Utilities
- Opacity — Layer transparent elements to complement shadow depth effects.
- Border Width — Combine borders with shadows to define surface edges clearly.