Box Shadow Generator

Build CSS box shadows visually. Multiple layers, presets, live preview, and Tailwind output.

0px
4px
16px
0px
15%
CSS
box-shadow: 0px 4px 16px 0px rgba(26,26,26,0.15);
Tailwind
shadow-[0px 4px 16px 0px rgba(26,26,26,0.15)]

CSS box-shadow: [inset] x-offset y-offset blur spread color. Stack multiple shadows for realistic depth — use a light subtle shadow combined with a larger diffuse shadow for the best results.

CSS Box Shadow Generator — Build Depth and Elevation in CSS

The CSS box-shadow property is one of the most powerful tools for conveying depth, elevation, and hierarchy in flat UI design. From subtle card lifts to bold popup highlights, carefully crafted shadows guide user attention and communicate interactive states without additional DOM elements. Colaro's box shadow generator lets you build and preview shadows visually, with instant CSS output you can paste directly into your stylesheet.

Understanding Box Shadow Parameters

A CSS box-shadow takes five parameters: horizontal offset (positive = right), vertical offset (positive = down), blur radius (how soft the shadow edge is), spread radius (how large the shadow extends beyond the element), and color. The optional inset keyword reverses the shadow direction for pressed/sunken effects. Layering multiple shadows with a comma-separated list creates sophisticated elevation systems — for example, combining a close sharp shadow with a far soft shadow mimics realistic light diffusion.

Elevation Systems and Shadow Design

Material Design and other leading design systems define elevation as a semantic property with corresponding shadow values at each level. A well-designed shadow system typically uses very subtle, warm-toned shadows (slightly towards the surface color) rather than pure black, as pure black shadows appear harsh and artificial. Using rgba() with low opacity values — typically 0.08 to 0.18 — produces softer, more natural-looking depth. Layer two shadows per elevation level: one tight shadow for contact definition and one wider shadow for ambient spread.

Can I add multiple box shadows?

Yes. CSS supports multiple shadows as a comma-separated list: box-shadow: 0 2px 4px rgba(0,0,0,0.1), 0 8px 24px rgba(0,0,0,0.08). Each shadow renders in order, front to back.

What is an inset box shadow?

Adding the inset keyword makes the shadow appear inside the element rather than outside — useful for pressed button states, form field focus rings, and sunken panel effects.

How do I make a colored shadow in CSS?

Replace the shadow's rgba black with any color: box-shadow: 0 8px 24px rgba(74, 144, 226, 0.35) creates a blue-tinted shadow that matches your brand color. Colored shadows are a distinctive design trend for accent components.