DevGrill

Box Shadow Generator

Design CSS box shadows with layers, then copy the CSS or a Tailwind class.

Runs in your browser

Presets:
px
CSS
box-shadow: 0 1px 2px rgb(15 23 42 / 0.06), 0 4px 8px -2px rgb(15 23 42 / 0.1);
Tailwind class
shadow-[0_1px_2px_rgb(15_23_42/0.06),0_4px_8px_-2px_rgb(15_23_42/0.1)]
Layers
px
px
px
px
%

How box-shadow works

box-shadow draws a shadow around an element from four numbers and a color: how far it moves right (X) and down (Y), how soft it is (blur) and how much bigger or smaller than the element it is (spread). inset puts the shadow inside the element instead, for pressed buttons and inner borders.

Realistic shadows usually stack several layers: a small, sharp one close to the element and larger, softer ones further away. Add up to six layers here, adjust each with sliders, and try them on your own box and background colors. Copy the result as CSS, or as a Tailwind arbitrary value like shadow-[0_4px_8px_rgb(0_0_0/0.1)].

How to use the Box Shadow Generator

  1. Start from a preset. Soft, raised, smooth layered, floating, hard edge, glow or inset.

  2. Adjust each layer. Pick a layer, then set its offsets, blur, spread, color and opacity, or make it inset.

  3. Check it on your colors. Set the box color, page background and corner radius to match your design.

  4. Copy the CSS or Tailwind class. Both update as you change the shadow.

Tips

  • Low opacity (5–15%) and a slightly negative spread look more natural than one dark shadow.
  • On dark backgrounds, shadows barely show; use a lighter border or a subtle glow instead.
  • Shadows don't change layout, so they're safe to animate on hover, but animating box-shadow on many elements can be slow; animating opacity of a shadow layer is cheaper.

Frequently asked questions

What's the difference between box-shadow and drop-shadow?

box-shadow follows the element's box (including its border radius). filter: drop-shadow() follows the actual shape, including transparent parts of images and SVGs, but can't do inset or spread.

Why is the Tailwind class so long?

It's an arbitrary value that holds the exact shadow, so it works without changing your Tailwind config. For shadows you reuse, add them to your theme instead.

Do all browsers support this?

Yes. box-shadow with several layers and inset works in every browser in use today.

Can I share a shadow?

Yes. The Share button makes a link that opens this exact shadow and preview colors.

Related tools