Box Shadow Generator

Design layered CSS box-shadows with a live preview.

Designing a shadow

Drag the sliders โ€” offset, blur, spread, opacity โ€” and watch the preview; stack up to five layers for depth, flip any layer inset for inner shadows, and copy the finished box-shadow rule. The presets encode the useful idioms: subtle card, soft float, layered depth, hard "brutalist" pop, inner glow.

What separates a good shadow from a smudge

Real light is diffuse, so believable elevation is several soft shadows at low opacity โ€” a tight one for contact, a broad one for ambience โ€” not one heavy blur at 50% black. That is the layered-depth preset, and it is how every design system's elevation scale works. Negative spread tucks a large blur behind the element, the secret of the floating-card look.

Technicalities worth knowing: box-shadow follows the element's border-radius, paints outside layout (it never pushes neighbours), and blur is expensive to animate โ€” animate a pseudo-element's opacity instead if hover effects stutter. In dark UIs shadows nearly vanish against dark backgrounds; raise elevation there by lightening the surface. The background half of the aesthetic is the gradient generator's department, and colours with proper contrast come from the colour converter's checker.

Frequently asked questions

What do the four box-shadow numbers mean?

Horizontal offset, vertical offset, blur radius and spread, then colour: 0 8px 24px -4px rgba(0,0,0,.25). Negative spread shrinks the shadow behind the element.

How do I make a shadow look natural?

Layer two or three soft shadows at low opacity instead of one heavy one โ€” small tight contact shadow plus large blurred ambient. The layered-depth preset demonstrates.

What is an inset shadow?

The inset keyword paints the shadow inside the element โ€” pressed buttons, wells, inner glows. Toggle it per layer here.

Do box shadows affect layout?

No โ€” they paint outside the box without moving neighbours, and they follow the element's border-radius automatically.