← All tools/Generators/Design/Box Shadow Generator

Box Shadow Generator

Design a CSS box shadow with sliders, preview it live and copy the code.

px
px
px
px
%

Move any slider and the preset switches to Custom. The preview box below shows the exact shadow.

Live preview

CSS code

Tailwind class

How it works

box-shadow: offset-x offset-y blur-radius spread-radius colour [inset];
Offset X moves the shadow sideways, Offset Y moves it down. Blur softens the edge, spread grows or shrinks the shadow.
Colour is written as rgba(red, green, blue, opacity), so the shadow stays see-through.
Inset puts the shadow inside the box instead of outside it.

Worked example: With the Soft preset — offset 0 and 8, blur 24, spread −8, black at 15% opacity — the code is “box-shadow: 0 8px 24px -8px rgba(0,0,0,0.15);”. Raise the blur to 40 and the same shadow turns into a wide, gentle haze; set the offset Y to 0 and the blur to 32 for a glow that spreads evenly on all sides.

Frequently asked questions

What does each box-shadow value do?

Offset X moves the shadow left or right and offset Y moves it up or down. Blur softens the edge, spread makes the shadow bigger or smaller, and the colour sets how dark it looks.

What is the difference between blur and spread?

Blur fades the edge of the shadow over a distance, while spread grows the whole shadow by a fixed amount. A negative spread, such as −8px, pulls the shadow in so it hugs the box.

What does inset do?

An inset shadow is drawn inside the box instead of outside it, which makes the box look pressed in or carved out — useful for input fields and panels.

How do I use the Tailwind class?

Copy the class, for example shadow-[0_8px_24px_-8px_rgba(0,0,0,0.15)], and paste it into your element’s class list. Tailwind’s arbitrary-value syntax turns it into the same box-shadow rule.

Why is the shadow colour written as rgba?

RGBA lets the shadow be partly see-through, so it blends with whatever sits behind the box. An opacity of 0.15 means the shadow is 15% black and 85% see-through.

More tools

Tell us what you think

Loving this tool, or stuck on something? Tell us — it takes a minute.

We’ll only use your name and email to reply if needed. The tool and page are filled in for you.