Skip to content
TabBench

CSS Box Shadow Generator

Generate multi-layer CSS box shadows with interactive preview, dark mode canvas, and Tailwind classes.

Runs in your browser. Nothing you add is uploaded.

What the CSS Box Shadow Generator does

Build a CSS box-shadow from up to five layers, see it live on a sample card against a light or dark background, and copy either the CSS value or a Tailwind arbitrary class. Each layer has its own X and Y offset, blur, spread, colour, opacity, inset switch and visibility toggle, which is how natural-looking shadows are made: a small, sharp shadow where the card meets the surface plus a large, soft one for ambient light. Five presets (subtle card, floating elevation, neon glow, neumorphic and dual rim) give you a starting point.

How to build a layered box shadow

  1. Pick a preset or start from the default layers.
  2. Select a layer and adjust its X and Y offset, blur, spread, colour and opacity; switch on Inset for an inner shadow.
  3. Add a layer (up to five), hide one with the eye icon to compare, or delete it.
  4. Switch the preview background between light and dark to check the shadow on both.
  5. Copy the CSS box-shadow value or the Tailwind shadow-[…] class.

The CSS Box Shadow Generator runs entirely in your browser — nothing you enter is uploaded, stored, or logged.

When to use it

Elevation levels for a design system

Cards, menus and dialogs read as sitting at different heights when their shadows grow with elevation: more Y offset and blur for higher surfaces, with opacity kept low. Building each level here and saving the values as tokens such as shadow-sm, shadow-md and shadow-lg keeps every component consistent.

Shadows that still work in dark mode

A black shadow almost vanishes on a dark background, which the dark preview shows straight away. Common fixes are a slightly stronger opacity, a faint 1px light ring (a layer with 0 offset, 0 blur, 1px spread and low-opacity white), or a lighter surface colour for raised elements.

Focus rings and glows

A layer with no offset and no blur but a 2–3px spread draws a crisp ring that, unlike a border, does not change the element's size; many focus styles are built this way. Several zero-offset, coloured, blurred layers make a glow.

Good to know

  • Negative spread pulls the shadow in from the edges so a large blur doesn't spill out sideways; the Floating Elevation preset pairs a 25px blur with −5px spread.
  • For everyday UI, keep black shadows at roughly 5–15% opacity. Heavier shadows look dated and muddy.
  • In the Tailwind class, spaces in the value are written as underscores, which Tailwind turns back into spaces.
  • Inset shadows are drawn inside the border and are the basis of pressed buttons and recessed inputs.
  • Shadows never affect layout, so adding one never moves the elements around it.

Frequently asked questions

Why use multi-layer box shadows instead of a single shadow?

Real-world light bounces in multiple ways. Stacking two or three subtle shadows with different blurs and spreads produces a much smoother, higher-end elevation effect that avoids harsh, unnatural edges.

Can I use the output in Tailwind CSS?

Yes. It produces a Tailwind arbitrary value such as shadow-[0px_10px_25px_-5px_rgba(0,_0,_0,_0.12)], with spaces written as underscores as Tailwind requires, ready to paste into your markup.

What does the spread radius do in box-shadow?

Spread grows or shrinks the shadow's shape before it is blurred. Positive spread makes the shadow larger than the element; negative spread makes it smaller, which keeps a soft shadow tucked under the element instead of spreading around all four sides.

Can box-shadow affect performance?

Static shadows are cheap. Animating box-shadow forces a repaint on every frame, which can stutter on low-end phones when many elements animate at once; a common workaround is to put the shadow on a pseudo-element and animate its opacity instead.

Page last updated . Found a wrong result or a mistake on this page? Let us know.