CSS Box Shadow Generator

Design CSS box shadows visually. Set the offset, blur, spread, color and inset, stack several layers for natural shadows, and copy the box-shadow CSS or Tailwind class.

Shadow layersLayer
Presets
Preview settings
CSS

                        
Tailwind CSS

Create CSS Box Shadows Visually

Good shadows make cards, buttons, menus and modals feel lifted off the page. This box shadow generator lets you shape a shadow with sliders and see it update live on a preview box, so you can find the right depth without guessing numbers.

Stack several layers for soft, realistic shadows, make inner shadows, glows and outlines, and start from presets that use the exact Tailwind CSS shadow values. Copy the box-shadow CSS or a Tailwind class: a built-in class when your shadow matches one, otherwise an arbitrary value.

Shadow settings turned into box-shadow CSS0 10px 15pxbox-shadowBox ShadowGenerator

How to create a box shadow

  1. Start from a preset or adjust the default shadow.
  2. Set the offsets, blur and spread with the sliders or by typing numbers. Pick the shadow color and opacity, and tick Inset for an inner shadow.
  3. Add layers for a softer, more natural result. Select a layer to edit it.
  4. Check it on your colors by changing the box color, background and border radius, then copy the CSS or the Tailwind class.

box-shadow syntax explained

box-shadow: [inset] offset-x offset-y blur-radius spread-radius color;

ValueWhat it doesExample
offset-xMoves the shadow right (positive) or left (negative)0
offset-yMoves the shadow down (positive) or up (negative)10px
blur-radiusHow soft the edge is. 0 is a sharp edge15px
spread-radiusGrows (positive) or shrinks (negative) the shadow-3px
colorUsually a transparent black or a tinted colorrgba(0, 0, 0, 0.1)
insetDraws the shadow inside the elementinset

Separate several shadows with commas; the first one is drawn on top.

Tailwind CSS shadow values

Tailwind CSS v3Tailwind CSS v4box-shadow
shadow-smshadow-xs0 1px 2px 0 rgb(0 0 0 / 0.05)
shadowshadow-sm0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)
shadow-mdshadow-md0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)
shadow-lgshadow-lg0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)
shadow-xlshadow-xl0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)
shadow-2xlshadow-2xl0 25px 50px -12px rgb(0 0 0 / 0.25)

For a custom shadow, use an arbitrary value such as shadow-[0_8px_16px_-4px_rgba(0,0,0,0.15)]. More examples are in the Tailwind shadow docs.

Why layered shadows look more natural

Real shadows are sharp and dark close to an object and softer further away. A single box-shadow cannot do both, but several layers with growing offset and blur can. The "Smooth" preset stacks five layers (1px, 2px, 4px, 8px and 16px) at low opacity, which gives a soft shadow without a muddy edge.

Two more tips: keep the light source consistent (usually from above, so use a positive y offset everywhere), and tint shadows on colored backgrounds with a darker shade of that color instead of pure black.

Inner shadows, glows and outlines

  • Inner shadow: add inset for pressed buttons and input fields: inset 0 2px 4px rgba(0, 0, 0, 0.12).
  • Glow: no offset, a large blur and a colored shadow: 0 0 24px 4px rgba(79, 70, 229, 0.55).
  • Outline without layout shift: only spread, no blur: 0 0 0 2px #4F46E5. Unlike a border, it does not change the element's size, which makes it great for focus rings.
  • Text shadows use a different property; see the Tailwind text shadow docs.

Frequently Asked Questions

Common questions about CSS box shadows.

Use the box-shadow property, for example box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);. Adjust the shadow above and copy the CSS.

Horizontal offset, vertical offset, blur radius and spread radius, in that order. Only the two offsets are required.

Use several layers with increasing offset and blur at low opacity, like the Smooth preset, and keep the light coming from above.

Tick Inset. It adds the inset keyword, which draws the shadow inside the element.

Copy the Tailwind class from the generator. If your shadow matches a default it shows the built-in class, otherwise an arbitrary value such as shadow-[0_8px_16px_-4px_rgba(0,0,0,0.15)].

No. Shadows are drawn outside the element’s box and do not take up space, so they never move other elements.

Yes. Click Add layer for each extra shadow. In CSS they are separated by commas.