CSS Box Shadow Generator
Visually create single or layered CSS box shadows with live preview, presets, and instant code output
Presets
Shadow Layers
Generated CSS
Drag sliders for offset, blur, spread, color, and opacity — see the shadow update on a live preview instantly. Stack multiple layers, try presets like Material Design or Neumorphism, and copy the final CSS in one click. And everything runs in your browser. Nothing gets uploaded.
How It Works
Each slider maps directly to a box-shadow parameter. When you move one, the preview element re-renders in real time using the updated CSS. Adding layers just comma-separates each shadow value in the output. Hit Copy and paste it straight into your stylesheet.
Examples
Subtle Card Elevation
The standard shadow for dashboard cards and content containers. Soft, barely visible, but it adds depth.
X: 0px
Y: 2px
Blur: 8px
Spread: 0px
Color: #000 at 8%
box-shadow: 0 2px 8px 0 rgba(0,0,0,0.08);
Neon Glow Button
You want a button that looks like it's glowing on a dark background. Two layers do the trick — a tight bright ring plus a wide soft bloom.
Layer 1: 0 0 10px 2px #00ff88
Layer 2: 0 0 40px 8px #00ff88 at 40%
box-shadow:
0 0 10px 2px #00ff88,
0 0 40px 8px rgba(0,255,136,0.4);
Neumorphism Input Field
That soft-plastic look where elements seem pressed into the background. Needs both a light and dark inset shadow on a matching background color — easy to mess up by hand, fast with sliders.
Layer 1: inset 4px 4px 6px #bebebe
Layer 2: inset -4px -4px 6px #ffffff
Background: #e0e0e0
box-shadow:
inset 4px 4px 6px #bebebe,
inset -4px -4px 6px #ffffff;
Who Uses This
Generating production-ready box-shadow values for cards, modals, and dropdowns without trial-and-error in DevTools.
Prototyping shadow depth and glow effects visually before handing off exact CSS values to the dev team.
Learning how each box-shadow parameter actually changes the output — way faster than reading docs alone.
Quickly matching a client's mockup shadow to working CSS during a screen share or revision call.
Common Mistakes
A big blur at 0 0 creates an even glow around the whole element. If you wanted a directional shadow (like light coming from above), add a Y offset of 4–8px. Glows are great on purpose — accidental ones look like a bug.
rgba(0,0,0,1) looks harsh and unnatural on any background. Real-world shadows sit around 8–20% opacity. Drop it to rgba(0,0,0,0.12) and the result is immediately better.
Negative spread shrinks the shadow smaller than the element, which is perfect for tight bottom-only shadows. Set Y to 6px, blur to 10px, and spread to -4px — you get a shadow that only appears underneath. Most people don't realize this is an option.
Technical Details
- Processing: 100% client-side — nothing leaves your browser
- Shadow Layers: Unlimited stacking, each independently configurable
- Output Format: Standard CSS box-shadow with optional -webkit- prefix
- Browser Support: Chrome, Firefox, Safari, Edge (all modern versions)
Frequently Asked Questions
What is CSS box-shadow?
It's a CSS property that draws one or more shadows around an element. Each shadow takes values for horizontal offset, vertical offset, blur radius, spread radius, and color. You can also mark it as inset to place the shadow inside the element instead of outside.
How do I add multiple shadows to one element?
Comma-separate the shadow values. So box-shadow: 0 2px 4px #0001, 0 8px 16px #0001; gives you two layers — a tight one for definition and a wider one for depth. This generator handles the commas for you; just click "Add Shadow" for each new layer.
What's the difference between blur and spread in box-shadow?
Blur controls how soft or diffused the shadow edge looks — higher values mean a more gradual fade. Spread changes the size of the shadow itself. Positive spread makes it bigger than the element, negative makes it smaller. A common trick: zero blur with positive spread creates a solid border-like shadow.
Does box-shadow affect layout or element size?
No. Shadows are purely visual and don't change the element's dimensions or push other elements around. They can overflow into neighboring space though, so if a parent has overflow: hidden, the shadow might get clipped. Keep that in mind when working inside tight containers.
Do I still need the -webkit- prefix for box-shadow?
Almost certainly not. Every major browser has supported the unprefixed version since around 2012. The prefix only matters if you're targeting really old Android stock browsers or Safari 5. This tool can add it optionally, but for most projects you can skip it.