CSS Box Shadow Generator
About this generator
Build production-ready CSS box-shadow declarations visually — adjust blur, spread, offset, color and opacity with a live preview, then copy the output. Toggle the preview shape between rectangle, circle, and pill to see how the shadow reads on different border-radius values before you ship.
The real power of box-shadow is layering. Material Design’s elevation system, every realistic floating-card UI, and the soft “natural light” look that makes a button feel premium — none of them are a single shadow. They’re 2-4 shadows stacked: a tight inner one for the contact shadow, a wider mid-tone for ambient occlusion, and sometimes a third diffuse one for the room glow. This generator’s ”+ Add Layer” button is the bridge between the Figma elevation token and the actual CSS that ships.
Two practical notes. (1) box-shadow follows the element’s bounding box, not the shape — for transparent SVGs and PNGs with cutouts, reach for filter: drop-shadow() instead, which follows the actual alpha channel. (2) For drop shadows on text, use the dedicated CSS Text Shadow Generator — text-shadow is a separate property with a slightly different parameter list.
Permalink: every adjustment you make is encoded into the URL hash, so you can bookmark a tuned shadow stack or send it to a teammate with a single share link.
How to use
CSS box-shadow syntax
| Property | Description |
|---|---|
offset-x | Horizontal distance — positive moves right, negative moves left. |
offset-y | Vertical distance — positive moves down, negative moves up. |
blur-radius | Higher = softer edge. 0 = sharp, hard shadow. |
spread-radius | Grows (+) or shrinks (−) the shadow size before blur. |
color | Any CSS color — use rgba() for transparent shadows. |
inset | Optional keyword. Turns the shadow inward (inner shadow). |
box-shadow snippets
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
box-shadow: inset 0 2px 8px rgba(0,0,0,0.25);
box-shadow: 0 1px 2px rgba(0,0,0,0.18), 0 4px 8px rgba(0,0,0,0.12), 0 16px 32px rgba(0,0,0,0.10);
/* For SVG / transparent PNG cutouts use filter, not box-shadow — it follows the alpha channel: */ filter: drop-shadow(0 4px 8px rgba(0,0,0,0.25));
Browser support
box-shadow is supported in every modern browser and has been since IE 9 — safe to use anywhere without a fallback.
Pro tips
See it used in real designs
Browse hand-coded collections that put this tool to work.