Box-Shadow Generator.
Design soft, layered or inset CSS box-shadows with a live preview and Tailwind output.
Runs in your browserAbout Box-Shadow Generator
The Box-Shadow Generator helps you design shadows that look natural instead of the flat gray smudge a single default shadow gives. Set the horizontal and vertical offset, blur, spread, color and opacity and watch the card in the preview update. The smooth layers option stacks several shadows whose offset and blur double at each step while the opacity is shared between them; four or five layers produce the soft, realistic elevation used by modern design systems. Inset turns the shadow inward for pressed buttons and input fields, and the extra layers box accepts any additional box-shadow values, such as a 1px hairline under a large ambient shadow. The output is a ready box-shadow declaration and a Tailwind arbitrary-value class like shadow-[0_8px_24px_rgb(0_0_0_/_0.2)]. For example, an offset of 0 16px, 40px blur, 24% slate and four layers gives a floating modal shadow. Common mistakes are using pure black at high opacity, which looks dirty on colored backgrounds (tint the shadow with the background hue instead), adding horizontal offset on interfaces lit from above, and animating box-shadow directly, which repaints on every frame; animate the opacity of a pseudo-element instead. Everything is calculated in your browser.
How to Use
- Adjust offset, blur, spread, color and opacity with the controls.
- Increase smooth layers for a softer shadow or switch on inset.
- Copy the CSS or the Tailwind class.
Frequently Asked Questions
What does spread do?
Spread grows (positive) or shrinks (negative) the shadow before it is blurred. A negative spread with a large Y offset makes a shadow that only shows below the element.
Why use several layers?
Real shadows have a sharp core and a wide soft falloff. Several layers with doubling blur imitate that much better than one big blur.
Does box-shadow affect layout?
No. Shadows are painted outside the box and do not take space, but they can be clipped by a parent with overflow hidden.
Is anything uploaded?
No. The CSS is generated in your browser.
Related Tools
Set each corner radius, including elliptical corners, and copy the shortest CSS or Tailwind classes.
Build linear, radial and conic CSS gradients with a live preview, OKLCH interpolation and Tailwind output.
Drag polygon points or pick a preset shape and copy the CSS clip-path for images and sections.
Convert between HEX, RGB, and HSL formats.
Experiment with flexbox and CSS grid container properties on live boxes and copy the CSS or Tailwind classes.
Check text and UI color contrast against WCAG 2.2 AA and AAA, with the closest passing colors.