About the Box Shadow Generator
The Box Shadow Generator lets you shape a CSS shadow with sliders instead of guessing pixel values. A white card in the preview shows the shadow as you adjust it, and the matching box-shadow declaration is ready to copy.
How it works
A CSS box-shadow takes up to four lengths and a color: horizontal offset (X), vertical offset (Y), blur radius, and spread radius. The generator writes them in that order in pixels, so the default is box-shadow: 0px 4px 12px -2px rgb(0 0 0 / 15%); a soft shadow that drops slightly below the card. Positive X moves the shadow right, positive Y moves it down, and a negative spread shrinks it so it peeks out mainly at the bottom.
The color is written as rgb() with an opacity percentage from the Opacity slider, so the color and its transparency can be set separately. Blur runs from 0 to 100, since CSS doesn't allow a negative blur. Ticking Inset adds the inset keyword, which draws the shadow inside the box instead of outside.
How to use
- 1
Drag the X and Y sliders to set which direction the shadow falls.
- 2
Use the Blur slider to soften the edge and the Spread slider to grow or shrink the shadow.
- 3
Click the color swatch and set Opacity, tick Inset for an inner shadow, or start from a preset such as Card or Glow.
- 4
Click Copy to copy the box-shadow declaration.
Worked examples
Default card shadow
A subtle shadow for content cards.
Inner shadow for an input
Making a text field look slightly recessed.
Colored glow
A blue glow around a focused button.
#2563eb is rgb(37, 99, 235); the Opacity slider adds the / 25% part.
Frequently asked questions
What does the spread value control?+
Spread grows (positive) or shrinks (negative) the shadow before it is blurred, independent of the blur amount. A negative spread keeps the shadow tucked under the element.
Can I add multiple shadows to one element?+
CSS allows it by separating values with commas. This tool designs one shadow at a time, so create each layer, copy it, and join them in your stylesheet.
What does the Inset option do?+
It adds the inset keyword, which draws the shadow inside the element's border, making it look pressed in rather than raised.
Why is my shadow not showing in the browser?+
Check that Opacity isn't 0, that the element has a background, and that it isn't clipped by overflow: hidden on a parent. An inset shadow only shows inside the element.
How do I change the shadow's transparency?+
Use the Opacity slider. It writes the alpha as a percentage, for example rgb(0 0 0 / 15%), where 0% is invisible and 100% is solid.