Shadow

Add or remove shadows to elements.

Syntax

Add a .shadow-* utility to a panel, or use .shadow for the regular elevation. Shadows use --shadow-sm, --shadow and --shadow-lg, so token overrides affect every matching utility.

HTML
<article class="card shadow-sm">Project summary</article>

Class and token reference

Class or patternEffect
.shadow-sm, .shadow, .shadow-lgApplies the small, regular or large shadow token.
.shadow-mdAlias for the regular shadow.
.shadow-0Removes the box shadow.
.hover-shadow-sm, .hover-shadow, .hover-shadow-lgApplies a shadow while the pointer hovers.
.hover-shadow-mdAlias for the regular hover shadow.

Compare elevation

Use shadow utilities to add different box shadow sizes to elements.

Small shadow
Regular shadow
Larger shadow
HTML
<div class="shadow-sm">Small shadow</div>
<div class="shadow">Regular shadow</div>
<div class="shadow-lg">Larger shadow</div>

Responsive behavior

Shadow utilities have no breakpoint variants. Use responsive Grid, Sizing and Spacings classes for the surrounding layout. Keep borders and visible focus indicators so the surface and its actions remain clear when shadows are unavailable.

Recipes

Make a flat panel

Use .shadow-0 to remove a box shadow from an element.

No shadow
HTML
<div class="shadow-0">No shadow</div>

Give a linked card hover feedback

Use a native link for navigation and keep its keyboard focus indicator. The hover shadow is supplementary visual feedback.

HTML
<a class="card hover-shadow p-3" href="/components/card">Read the Card reference</a>