Box Shadow Generator
Create a CSS box shadow with a visual editor.
CSS Box Shadow Generator: Design Realistic Elevation & Multi-Layered Drop Shadows
Drop shadows are what separate amateurish, flat interfaces from polished, tactile digital experiences. A well-crafted shadow gives a card elevation, signals that a button is clickable, and makes floating navigation bars appear to glide smoothly above page content.
Yet many developers create harsh, muddy shadows: box-shadow: 0 10px 20px #000;. A single pitch-black shadow with a high opacity looks like an outdated design from 2005. In the physical world, natural sunlight scatters, creating soft, diffuse, layered ambient shadows that fade gradually into their surroundings.
Our free Box Shadow Generator lets you sculpt modern, realistic CSS box shadows with interactive sliders. Tweak horizontal offset, vertical elevation, blur radius, spread distance, and color opacity in real time. Layer multiple shadows, preview inset effects, and copy ready-to-paste CSS or Tailwind classes in one click.
Deconstructing the CSS Box Shadow Syntax
Controls the horizontal (left/right) and vertical (up/down) light source direction. Positive Y moves the shadow downwards, simulating overhead light.
Controls the softness of the shadow edge. Higher values create diffuse, ambient glows; a value of 0 creates a sharp, solid outline shadow.
Expands or contracts the shadow footprint before blurring. Positive values enlarge the shadow; negative values tuck it neatly behind the card.
Turns the shadow inside-out, casting shadows within the element's frame. Widely used for debossed buttons and sunken form inputs.
The Secret of Premium Modern UIs: Layered Shadows
Take a look at websites designed by Apple, Stripe, or Linear. Their shadows look soft, organic, and physically real. Their secret is shadow layering—stacking two or more subtle shadows together rather than using one aggressive blur:
❌ Harsh Single Shadow (Outdated)
box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
Looks muddy, creates an unnatural black halo around card borders.
✅ Layered Ambient Shadow (Modern)
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 8px 16px rgba(0, 0, 0, 0.06), 0 16px 32px rgba(0, 0, 0, 0.08);
Produces silky, natural depth that blends into modern typography.
Designing Shadows for Dark Mode
One critical mistake in dark UI themes is keeping black shadows on dark backgrounds. A black shadow on a dark slate or charcoal background is completely invisible, destroying all visual elevation hierarchy!
The Dark Mode Solution: In dark mode, simulate elevation by using lighter surface background colors (e.g., elevation 1 is #1e293b, elevation 2 is #334155), paired with subtle, low-opacity white or brand-colored borders (border: 1px solid rgba(255, 255, 255, 0.08)) and soft ambient glows.
Frequently Asked Questions
What is the difference between drop-shadow() and box-shadow?
box-shadow casts a shadow strictly around an element's rectangular bounding box (or rounded border radius). The CSS filter: drop-shadow() function, on the other hand, contours to the exact transparent alpha pixels of a PNG image or SVG icon.
Can I export box shadows directly into Tailwind CSS?
Yes. You can copy the raw CSS value to paste into your tailwind.config.js under theme.extend.boxShadow, or use Tailwind's arbitrary property syntax (e.g. shadow-[0_8px_30px_rgb(0,0,0,0.12)]).
Do heavy box shadows cause mobile scrolling lag?
Extremely large blur radii (e.g. 100px+) combined with complex spread values on dozens of animating cards can trigger repaints on mobile GPUs. Using moderate blurs (8px to 32px) and caching elements via transform: translateZ(0) ensures 60 FPS scrolling.