simpletool.io

CSS Box Shadow Generator

Layer shadows with a live preview and copy-ready CSS.

Generation is browser-side. Nothing is logged.
Generated CSS
box-shadow: 0px 4px 12px -2px rgba(10, 37, 64, 0.15);

What is a CSS Box Shadow Generator?

A box shadow generator is a visual editor for CSS's box-shadow property. Drag sliders for offset, blur, spread, and colour, add multiple stacked layers, and copy a production-ready CSS declaration. The visual editor is particularly valuable here because the syntax packs five-plus parameters into one line, with no argument names — a developer working from memory frequently ends up with something that looks subtly wrong.

The box-shadow syntax is: [inset] offset-x offset-y blur-radius spread-radius colour. The offsets move the shadow horizontally (positive = right, negative = left) and vertically (positive = down). Blur radius softens the edge of the shadow; zero produces a hard-edged shape, higher values fade it gradually.Spread radius grows or shrinks the shadow before blur is applied; negative spread pulls the shadow tighter than the element, which creates the "floating underneath" look seen in modern UI design. Inset flips the shadow to render inside the element, useful for pressed-button states, inset shadows on form fields, and the classic Neumorphic "soft UI" look.

Stacked shadows are where the technique gets interesting. Separate multiple shadow declarations with commas and the browser layers them in order (first on top). The canonical "realistic depth" pattern is two shadows — a tight one close to the element for the contact shadow and a wider, softer one below for ambient light. Stripe, Airbnb, Linear, and most modern product-design systems use two- or three-layer shadows rather than a single blurry one.

Colour matters. A pure black shadow at rgba(0,0,0,0.25) can look heavy and grey. Use a saturated tint of the background: for a blue-grey dashboard, tryrgba(10, 37, 64, 0.12). Shadows slightly tinted toward your brand anchor blend in more naturally than pure black.

Performance considerations matter for animated shadows. Browsers do not GPU-acceleratebox-shadow interpolation — animating the shadow (e.g., growing it on hover) repaints the composited layer every frame and can drop frame rate on complex pages. The common workaround is to fake it with a pseudo-element, animate its opacity, and keep the shadow at a fixed size.

Accessibility: shadows are decorative; they should not carry information users cannot otherwise perceive. For interactive elements (buttons, cards), rely on colour, text weight, or border changes in addition to shadow for states that matter — hover, focus, selected.

How to generate CSS box shadows

  1. Start with one shadow layer — adjust X/Y offsets to position it.
  2. Tune blur and spread. More blur = softer edge; negative spread pulls the shadow tighter than the element.
  3. Set the colour — slightly-tinted semi-transparent hues work better than pure black.
  4. Add a second layer for realistic depth — a tight contact shadow plus a wider ambient one.
  5. Toggle inset for pressed-button or Neumorphic effects.
  6. Copy the CSS and paste into your stylesheet.

Features

  • Unlimited stacked shadow layers with per-layer inset toggle.
  • Live preview of the exact CSS on a configurable box.
  • Background, box, and border-radius controls for realistic context.
  • Copy-ready CSS with one click.
  • Runs entirely in your browser.

Frequently asked questions

What's the difference between blur and spread?
Blur softens the shadow's edge — it's the fade distance. Spread grows or shrinks the shadow before blur is applied. Negative spread pulls the shadow tighter than the element, which creates the 'floating under' look popular in modern UI.
Why layer multiple shadows?
Real-world depth comes from multiple light sources. A tight low-blur shadow mimics contact with the surface; a wider softer shadow mimics ambient light. Layering both produces more realistic depth than a single blurry shadow.
What does 'inset' do?
Inset renders the shadow inside the element instead of around it. Use for pressed-button states, form-field inner shadows, or the soft 'recessed' look of Neumorphic UI.
Can I animate box-shadow?
Yes, but it's not GPU-accelerated and can hurt performance on complex pages. For hover effects, consider animating the opacity of a pseudo-element that carries the shadow, or using transform: scale() instead.
Is this CSS cross-browser compatible?
Yes. box-shadow has worked in every browser since IE9; the inset keyword and multi-layer support are universal. No vendor prefixes needed.