CSS Box Shadow Generator

Build CSS shadows with sliders for offset, blur, spread, color, and opacity. Live preview, multi-shadow stacking, copy as CSS or Tailwind.

CSS
box-shadow: 0px 4px 16px 0px rgba(0, 0, 0, 0.08);
Tailwind
shadow-[0px_4px_16px_0px_rgba(0,_0,_0,_0.08)]
Shadow layers
Layer 1
Offset X0px
Offset Y4px
Blur16px
Spread0px
Opacity8%

01 — Overview

How the CSS Box Shadow Generator works

Compose box shadows visually. Stack multiple layers, tweak offset, blur, spread, color, and opacity for each, and watch the preview update live. Output as plain CSS or as a Tailwind arbitrary value. Common shadow presets are one click away.

02 — Use cases

When to use the CSS Box Shadow Generator

  1. 01

    Find the right elevation for a card without 5 minutes of trial and error

  2. 02

    Build a layered shadow that doesn't look like a default Material drop

  3. 03

    Translate a Figma shadow effect into CSS for production

  4. 04

    Get the Tailwind arbitrary-value form of a custom shadow

03 — Examples

CSS Box Shadow Generator examples

soft elevation, 4px y-offset, 16px blur, 8% opacity

ex 01

box-shadow: 0 4px 16px 0 rgba(0,0,0,0.08);

A subtle card-elevation shadow.

two-layer crisp shadow

ex 02

box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 4px 12px rgba(0,0,0,0.08);

A near-surface highlight stacked with a softer ambient layer.

focus ring, 3px accent at 40% opacity

ex 03

box-shadow: 0 0 0 3px rgba(163, 230, 58, 0.4);

Zero offset and zero blur turns box-shadow into a ring that ignores the layout box.

pressed state for a button

ex 04

box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);

An inset shadow along the top edge reads as the surface being pushed in.

04 — FAQ

Box Shadow — frequently asked questions

What is shadow spread?

Spread grows (positive) or shrinks (negative) the shadow before blur is applied. A positive spread creates a halo; a negative spread keeps the shadow inside the element's bounds.

Should I use inset shadows?

Inset shadows render inside the element. They're useful for pressed-button affordances and neumorphic effects, but readable depth usually comes from outset shadows.

How do I avoid the 'AI default' shadow look?

Single hard shadows tend to look generic. Stack two or three layers — a tight near-surface shadow plus a softer ambient one — and bias the color slightly toward the surrounding hue instead of pure black.

How do I make a shadow that still reads in dark mode?

Black shadows disappear against dark surfaces because there's nothing left to darken. Two things work instead: a hairline border a little lighter than the surface, or an inset highlight along the top edge that mimics a light source. Keep the drop shadow too, but expect it to do almost none of the work.

What's the difference between box-shadow and drop-shadow?

box-shadow follows the element's border box, so a transparent PNG casts a rectangular shadow. filter: drop-shadow() follows the alpha channel, so it traces the actual shape — the right choice for logos, icons, and cutouts. drop-shadow has no spread parameter.

Do box shadows hurt performance?

Large blur radii are expensive to repaint, and the cost scales with the blurred area rather than the element size. One big shadow is fine; dozens animating at once is not. If you need a shadow to change on hover, cross-fade a second pre-rendered layer's opacity rather than animating the shadow values.

05 — Reference

Specs and further reading

The primary sources this tool follows. Where behaviour is defined by a specification, we link the specification rather than a summary of it.

07 — More

Tools that pair with Box Shadow

Last updated .