CSS Box Shadow Generator with Layers
Design single or multi-layer box shadows visually: offsets, blur, spread, colour, opacity and inset per layer, Material elevation and smooth layered presets, a live preview on any background, and copy-ready CSS or Tailwind.
Box Shadow Workspace
Adjust each layer with the sliders. The preview and the CSS update instantly; add layers for realistic depth.
box-shadow: 0px 4px 6px -1px rgba(15, 23, 42, 0.1),
0px 2px 4px -2px rgba(15, 23, 42, 0.1);Why Front-End Developers Use the Agenvix Box Shadow Generator
Realistic shadows come from layers, and layers are tedious to write by hand.
Multi-Layer by Default
Stack as many shadows as you need, reorder them, toggle inset per layer and see the combined result immediately.
Production Presets
Start from Material elevation, soft card, smooth layered, neumorphic, hard offset and glow presets, then tweak.
CSS and Tailwind
Copy a standard box-shadow declaration or a Tailwind arbitrary value class, with colours written as rgba for alpha.
Preview in Context
Change the preview background, box colour and corner radius to match your actual component before you copy.
Simple as 1-2-3
How the Box Shadow Generator Works
Three steps to a polished shadow.
Pick a Starting Point
Choose a preset or begin with the default two-layer card shadow.
Shape Each Layer
Drag the X, Y, blur, spread and opacity sliders, choose a colour and toggle inset. Add or remove layers as needed.
Copy the Code
Copy the CSS declaration or the Tailwind class and paste it into your stylesheet or component.
box-shadow Parameters
What each value controls and sensible ranges.
| Feature / Specification | Best Use Case | Engine / Output Standard | Privacy & Security | Performance Rating | Action |
|---|---|---|---|---|---|
| Offset X / Y | Light direction | px, negative allowed | -50 to 50 px | Core | |
| Blur radius | Softness of the edge | 0 = hard edge | 0 to 100 px | Core | |
| Spread radius | Grow or shrink the shadow | Negative tightens | -50 to 50 px | Optional | |
| Colour + opacity | Tinted, realistic shadows | rgba() output | 0 to 100% | Core | |
| inset | Pressed states, inner glows | Shadow inside the box | Per layer | Optional | |
| Multiple layers | Natural depth | Comma-separated, first on top | Unlimited | Recommended |
Designing Shadows That Look Real
1. Anatomy of box-shadow
The syntax is box-shadow: [inset] x y blur spread color. X and Y move the shadow, blur softens its edge, spread grows it in every direction, and the colour almost always needs alpha so underlying content shows through. Multiple shadows are separated by commas and painted in order, with the first one on top.
2. Why layered shadows look better
Real shadows have a tight dark core and a wide faint penumbra. One blur cannot do both, so designers stack several layers with increasing offset and blur at low opacity.
- Keep each layer between 5 and 15 percent opacity; the layers add up.
- Double offset and blur on each successive layer for a smooth falloff.
- Keep Y larger than X so the light appears to come from above.
3. Tinted shadows and dark mode
Pure black shadows look muddy on coloured backgrounds. Tint the shadow with a darker version of the background hue, or with the brand colour for glow effects. In dark mode shadows are barely visible against dark surfaces, so designers raise the surface colour slightly instead and use shadows mainly for overlays and menus.
4. Performance considerations
Large blur radii on many elements cost paint time, especially when animated. Animate opacity or transform instead of the shadow itself, for example by cross-fading a pseudo-element that carries the hover shadow. Prefer filter: drop-shadow() only when you need the shadow to follow a non-rectangular shape such as a PNG or SVG.
Everything you need to know about CSS box shadows
Syntax, layering, Tailwind and performance.
What is the difference between blur and spread?
Blur softens the shadow edge without changing its size much; spread enlarges (positive) or shrinks (negative) the shadow before blurring. Negative spread with moderate blur is the classic trick for shadows that do not leak out of the sides.
How do I make a shadow appear only on one side?
Use a Y offset with a negative spread roughly equal to the blur, for example 0 8px 8px -8px. The negative spread pulls the shadow in so only the offset side shows.
Can I use the output in Tailwind CSS?
Yes. The Tailwind tab outputs an arbitrary value class such as shadow-[0_4px_6px_-1px_rgba(15,23,42,0.1)] with spaces replaced by underscores, which Tailwind v3 and v4 accept directly.
Does box-shadow affect layout?
No. Shadows are painted outside the box model and do not change element size or trigger reflow, but they do add to paint cost.
Why does my inset shadow not show?
Inset shadows are drawn inside the padding box and are hidden by an opaque child that fills the element. Add padding or reduce the child size, and remember a background image on the same element paints below the inset shadow.
How many layers should I use?
Two or three layers cover most UI needs. Five-layer smooth shadows look excellent on large cards and modals but are overkill for buttons.
Is box-shadow supported everywhere?
Yes. Unprefixed box-shadow has worked in every browser since 2012, including inset and multiple layers.
Is my design stored anywhere?
No. The generator runs in your browser; nothing is sent to Agenvix.
Related Developer Utilities
Discover companion utilities engineered for zero-log speed and browser-side execution.
CSS Gradient Generator
Design linear and radial gradients with precise colour stops and copy production ready CSS.
Color Converter
Convert HEX, RGB, HSL, HSV and CMYK colours with alpha, WCAG contrast checks and tint and shade scales.
PX to REM Converter
Convert px to rem and em at any root font size, including bulk conversion of whole CSS snippets.
Aspect Ratio Calculator
Reduce any dimensions to a ratio, solve the missing width or height and copy CSS aspect-ratio code.
Icon Pack Generator
Generate favicon suites (16x16 up to 512x512) and HTML meta code from any image.
Image Converter
Convert PNG, JPG, WebP, BMP, GIF, TIFF images in your browser with zero server upload.
More in Media & Graphics
Specialized utilities within the same technical domain
