CSS box-shadow generator
Compose a CSS box-shadow with a live preview, then copy the value.
Runs 100% in your browserHow to use the box-shadow generator
- Drag the sliders. Adjust offsets, blur, spread and color — the preview updates live.
- Pick inset or outer. Toggle the inset checkbox for an inner shadow effect.
- Copy the CSS. Click Copy to grab the box-shadow value and the full rule.
Four lengths, one effect
box-shadow is the workhorse of UI depth — cards, modals, dropdowns and focus rings
all lean on it. The syntax is offset-x offset-y blur spread color. Offsets move the
shadow (positive x/y push it right and down, negatives pull it up and left). Blur
softens the edge — zero is a hard silhouette, larger values feather it out. Spread
grows the shadow before the blur is applied, or shrinks it when negative — the one parameter
text-shadow lacks. A negative spread paired with a downward
offset gives the "lifted just off the page" look, where the cast is narrower than the element
itself.
inset and stacking shadows
The inset keyword flips the shadow inside the box, which is how pressed buttons,
inset form fields and neumorphic surfaces are built. You can list several shadows on one
property, comma-separated, and they paint back-to-front (the first one sits on top). Real
elevation systems exploit this: a tight, dark, low-blur shadow for the contact edge plus a wide,
soft, lighter one for the ambient cast reads far more convincingly than any single shadow.
Stacking an inset light shadow over an outset dark one is the classic two-tone bevel.
Making shadows look real (and stay fast)
Believable shadows are low-alpha and slightly downward, mimicking a light source above —
something like rgba(0,0,0,0.12), never solid black. Tinting the shadow toward the
background or the element's own hue beats flat grey. For performance, prefer
box-shadow over wrapping elements in blurred images, but animate it sparingly: a
large blur repaints a wide area, so for hover lifts it's cheaper to cross-fade between two
predefined shadows, or animate transform, than to tween the blur radius live.
Frequently asked questions
- A CSS property that draws one or more shadows around an element's border box, defined as offset-x offset-y blur spread color, with an optional inset keyword.
- Yes — CSS accepts a comma-separated list. This tool focuses on one shadow at a time; copy a layer and append additional shadows by hand for multi-layer effects.
- Blur softens the shadow edge. Spread grows (positive) or shrinks (negative) the shadow before blurring, useful for creating offset rings.
- Tailwind reads any arbitrary value via the box-shadow utility, e.g. shadow-[0_4px_12px_rgba(0,0,0,0.15)]. Copy the value, drop it into the brackets.