Skip to content

Box Shadow Generator

Build CSS box shadows with as many layers as you need: adjust offset, blur, spread, colour and opacity per layer, toggle inset, and preview the result on a card over light and dark backgrounds. Copy the box-shadow declaration or the equivalent Tailwind shadow-[...] class.

Runs in your browserFreeNo sign-up

Processed on your device. Files and text stay in your browser and are not uploaded to our servers. How privacy works

How to use the box shadow generator

  1. Start from a preset (soft, elevated, hard, neon, inset) or the default two-layer shadow.
  2. Tune each layer's X and Y offset, blur, spread, colour and opacity with the sliders; switch on inset for an inner shadow.
  3. Add, duplicate or remove layers to build depth; watch the preview on both backgrounds.
  4. Copy the CSS or the Tailwind class into your project.

Features

  • Up to eight stacked shadow layers with per-layer controls
  • Colour with alpha, rendered as rgba() so it blends on any background
  • Inset shadows for pressed or recessed effects
  • Live preview over light and dark surfaces
  • CSS box-shadow output and Tailwind arbitrary value output

Anatomy of a box-shadow

Each layer is: [inset] offset-x offset-y blur-radius spread-radius color.

  • Offset X/Y move the shadow right/down (negative values go left/up).
  • Blur softens the edge; 0 gives a hard, flat shadow.
  • Spread grows (positive) or shrinks (negative) the shadow before blurring; negative spread with a large blur keeps the shadow tight under the element.
  • Colour opacity does most of the work. Real shadows are low-opacity black or a darkened version of the background hue, rarely solid grey.
  • Multiple layers are separated by commas; the first layer is painted on top.

Shadows that look natural

Design systems usually combine two layers: a small, sharp shadow (y 1–2px, blur 2–4px) for the contact edge and a larger, softer one (y 8–12px, blur 16–24px, negative spread) for ambient light. Keep the light direction consistent across the page (usually from the top) and reduce opacity on dark backgrounds where shadows barely show; a subtle border often reads better there.

Frequently asked questions

Why doesn't my shadow show on a dark background?

A black shadow on a near-black surface has nothing to contrast with. Use a lighter or coloured shadow (the Neon preset), or add a 1px border with a slightly lighter colour instead.

Does box-shadow affect layout?

No. Shadows are painted outside the box and do not take up space or trigger scrollbars, though they can be clipped by a parent with overflow: hidden.

How do I use the Tailwind output?

Paste the shadow-[...] class on the element. Tailwind generates the CSS at build time; underscores in the value become spaces.

Is box-shadow expensive to render?

Large blurs on many elements, especially animated ones, can cost paint time. Animate opacity or transform instead of the shadow itself, and prefer fewer layers on lists.

Other tools people use alongside Box Shadow Generator.

You might also like

Something useful from another corner of VoltKit.