Box Shadow Generator
100% LocalDesign CSS box-shadow effects with a visual editor.
Adjust offset, blur, spread, and color. Layer multiple shadows for depth effects.
Learn More
What is Box Shadow Generator?
Frequently Asked Questions
Technical Deep Dive
Box Shadow Generator
Create beautiful CSS box-shadow effects using interactive sliders. Support for multiple shadow layers, inset shadows, and popular presets including neumorphism. Preview in real time and copy the generated CSS.
Pixel-Precise Output
Generates CSS, tokens, or assets that match what your design system expects.
Live Visual Preview
See changes the moment you make them, no copy-paste cycle between tool and IDE.
Copy-Paste Ready
Output is formatted for direct use in stylesheets, Tailwind configs, or Figma tokens.
01 Box Shadow Anatomy
| Parameter | Function | Impact |
|---|---|---|
Offset X/Y | Directional Shift | Simulates light angle |
Blur Radius | Edge Diffusion | Simulates distance from surface |
Spread Radius | Footprint Scaling | Simulates light source size |
Inset | Inner Clipping | Simulates recessed surfaces |
02 Professional Shadow Techniques
-
Smooth Shadow Falloff Avoid "sticker" looks by using multiple layers with extremely low opacity (0.05 - 0.1) and increasing blur radii.
-
Negative Spread Trick Use a negative spread to shrink the shadow's footprint, anchoring the elevation effect directly beneath the element.
-
Performance Guardrails Large blurs trigger expensive paint operations. For animations, consider
will-change: transformto move shadows to GPU layers.
03 Shadows in Production Design Systems
Shadows are not decoration, they are spatial language. Mature design systems codify elevation as a small set of named tokens, then enforce them everywhere. Here is how shadows actually show up in shipping product code.
-
Elevation Tokens (Material's 0/1/2/4/8/16/24dp Scale) Material Design 3 defines six elevation levels mapped to dp values. Each level is a layered shadow recipe, an ambient shadow plus a directional key-light shadow. Pick a level for a component (Card = 1dp, Menu = 8dp, Dialog = 24dp) and never write a one-off shadow.
-
Focus Rings as box-shadow, not outline CSS
outlineignoresborder-radiuson older browsers and renders as a sharp rectangle around rounded buttons. Usingbox-shadow: 0 0 0 3px hsl(217 91% 60% / 0.5)for focus produces a ring that follows the corner curve. Tailwind'sring-*utilities are literally box-shadows underneath. -
Dark-Mode Shadow Tweaks Pure black shadows disappear on dark backgrounds. Mature systems either drop shadow opacity entirely (Stripe, Linear) or use a saturated-color shadow,
hsla(220, 60%, 4%, 0.5)instead ofhsla(0, 0%, 0%, 0.2). Use a CSS variable per theme so the same component picks the right recipe automatically. -
Inset Shadows for Recessed UI Pressed-button states, depressed input wells, and toggle tracks all use the
insetkeyword. A subtleinset 0 2px 4px rgba(0,0,0,0.06)on an input gives keyboard users a clear well to type into without adding a border. -
Tinted Shadows for Colored Surfaces A blue card with a neutral-gray shadow looks dirty. Tint the shadow with the surface's own hue at low saturation and high darkness, the shadow reads as a deeper version of the card, not a smudge underneath it.
04 Worked Examples
/* Naive (wrong), a single layer reads like a flat sticker */
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
box-shadow:
0 5px 5px -3px rgba(0, 0, 0, 0.20), /* key light, sharp, close /
0 8px 10px 1px rgba(0, 0, 0, 0.14), / ambient mid /
0 3px 14px 2px rgba(0, 0, 0, 0.12); / ambient diffuse /The layered approach simulates two physical light sources, a directional one casting the sharp shadow and an ambient one casting the diffuse halo. Real-world shadows are never one layer.
background: hsl(220, 60%, 50%);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); /dirty grey halo */
background: hsl(220, 60%, 50%);
box-shadow: 0 8px 24px hsla(220, 60%, 30%, 0.18);The shadow now reads as a deeper extension of the card's own color rather than a separate ink stain. Stripe and Linear both ship colored-shadow recipes for their accent surfaces.
.btn {
box-shadow: 0 1px 2px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.06);
}:active, swap to an inset shadow so the button reads as pressed-in:.btn:active {
box-shadow: inset 0 2px 4px rgba(0,0,0,0.12);
transform: translateY(1px);
}Inset shadows let you reuse the same element for raised and depressed states without restructuring the DOM. Combine with a 1px translate for tactile feedback.
05 Related Tools
Shadows rarely ship alone. They live next to radius, gradients, filters, and motion. These companion tools pair naturally with the box-shadow generator when you are dialing in a card or elevated surface.
Border Radius Generator
Match focus-ring shadows to the exact corner curve of a button, otherwise the ring slices through rounded edges.
Text Shadow Generator
Box-shadow's typographic sibling, useful for letterpress, neon, or duotone heading treatments on the same elevation scale.
Easing Visualizer
Animate shadow transitions (hover-to-lift) with the right curve, linear easing on a shadow looks robotic; ease-out matches physical settling.