Multi-layer box-shadow builder with Material elevation presets and Tailwind export—part of the Design & UI effect chain (border-radius → shadow → gradient).

Skip to box shadow generator

Box Shadow Generator

Example output

box-shadow: 0px 8px 24px 0px rgba(0,0,0,0.15);

Multi-layer box-shadow with live preview—computed locally, nothing uploaded. Pair rounded corners from Border Radius Generator; stack with CSS Gradient Generator.

Create single or multi-layer CSS box shadows. Use presets, tweak layers, and export as CSS, inline style, or Tailwind config.

Layer 1
px
px
px
px
%

Controls

Mode

Inset, Neumorph, and Glow apply a preset to your layers. Normal mode adds standard layers when you click Add layer.

Presets
Elevation
Effects
UI Patterns
Layers (1)

Preview

Shape
Background

Export

box-shadow: 0px 8px 24px 0px rgba(0,0,0,0.15);
boxShadow: "0px 8px 24px 0px rgba(0,0,0,0.15)"
Key:
boxShadow: {
  'custom': '0px 8px 24px 0px rgba(0,0,0,0.15)'
}

What is CSS box-shadow?

The CSS box-shadow property adds shadow effects around an element's frame. Each shadow is defined by four length values (x offset, y offset, blur radius, spread radius), a color, and an optional inset keyword. You can stack multiple shadows by separating them with commas — a technique used for layered glows, neumorphism, and rich elevation effects.

Box shadows are rendered outside the element's layout by default, meaning they don't affect surrounding elements. They are GPU-composited in modern browsers, making them cheaper to animate than properties that trigger layout (like margin). For clipped children or non-rectangular elements, consider filter: drop-shadow() instead.

Understanding the box-shadow syntax

box-shadow: [inset] <x> <y> <blur> <spread> <color>;
ParameterWhat it controlsTypical value
X offsetHorizontal shadow position. Negative = left.0 to ±20px
Y offsetVertical shadow position. Positive = below.2px to 16px
Blur radiusLarger = softer edges. 0 = hard shadow.4px to 30px
Spread radiusExpands or contracts shadow size. 0 = same as element.-4px to 8px
ColorUse rgba() for transparency. Dark colors for elevation, light for neumorphism.rgba(0,0,0,0.1–0.3)
insetMoves shadow inside the element. Used for pressed/active states.optional keyword

When to use box-shadow in UI design

Elevation and depth

Use subtle downward shadows (small Y, medium blur) to lift cards, modals, and dropdowns above the page. Larger blur and spread = higher elevation. Follow a consistent elevation scale to keep depth readable across your UI.

Focus rings and accessibility

Inset or outset shadows make excellent custom focus indicators. They respect border-radius, are animatable, and don't affect layout — making them a solid alternative to outline for keyboard-navigable components.

Hover and interactive states

Animate box-shadow on hover (transition: box-shadow 0.2s) to create a lift effect. Increase Y offset and blur on hover to signal interactivity without moving the element in the layout.

Neumorphism / soft UI

Use two shadows — one light (white or near-white, negative offset) and one dark (gray/black, positive offset) — against a matching background to create the soft-extruded look. Works best with pastel backgrounds and rounded corners.

Glow effects

Set X and Y to 0, use a large blur, and use a colored rgba() value to create a glow. Common for neon UI, status indicators, and hover states on colored buttons.

Inset pressed states

Add an inset shadow on :active to simulate a pressed button. Reduce Y offset and blur, keep it subtle — this gives tactile feedback without moving the element.

Common box-shadow patterns

Subtle card elevation

box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);

Medium elevation (modal/dropdown)

box-shadow: 0 4px 16px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.08);

Strong elevation (floating action)

box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 4px 8px rgba(0,0,0,0.1);

Colored glow (button hover)

box-shadow: 0 0 20px rgba(59,130,246,0.5);

Neumorphism flat

box-shadow: 6px 6px 12px #b8b9be, -6px -6px 12px #ffffff;

Inset pressed state

box-shadow: inset 0 2px 6px rgba(0,0,0,0.15);

Performance considerations

Box shadows are GPU-composited and cheaper than many CSS properties, but a few patterns can hurt performance:

  • Animating box-shadow triggers repaint — if you animate shadows on scroll or resize, consider using will-change: box-shadow or animate a pseudo-element's opacity instead.
  • Too many layers — stacking 5+ shadows on hundreds of elements can slow rendering. Use 1–2 layers for most UI patterns; save multi-layer shadows for featured cards.
  • Large blur on mobile — high blur values on large elements can be expensive on mobile GPUs. Test on real devices and reduce blur/spread if needed.
By Muhammad Abdullah Rauf · Founder, EverydayTools.proUpdated 2026-07-07· Reviewed by EverydayTools Editorial Team

What is CSS box-shadow builder?

Free CSS box-shadow generator with multi-layer controls, Material-style elevation presets, and live preview. Tune X/Y offset, blur, spread, and rgba color—then copy CSS, inline style, or Tailwind boxShadow config. Runs locally in your browser; no signup.

Stack box-shadow layers visually, preview on card/button/panel shapes, and copy production-ready CSS or Tailwind in one click.

Who uses CSS box-shadow builder?

Common real-world scenarios where this tool saves time.

Card and modal elevation

Dial Y offset and blur for dropdowns, dialogs, and floating panels using a consistent elevation scale.

Button hover and pressed states

Export inset shadows for :active states and deeper shadows for :hover lift effects.

Tailwind theme tokens

Copy a boxShadow entry for tailwind.config.js without hand-escaping rgba values.

How to use CSS box-shadow builder

  1. Pick a preset or mode

    Start with an elevation preset (Soft, E1–E5, FAB, Modal) or choose Inset, Neumorph, or Glow mode to load a starting stack.

  2. Tune shadow layers

    Adjust X/Y offset, blur, spread, color, and opacity per layer. Add layers for stacked elevation or dual-shadow neumorphism.

  3. Preview on your UI shape

    Switch the preview between card, button, and panel on light or dark backgrounds to judge contrast.

  4. Copy CSS or Tailwind

    Copy the CSS box-shadow rule, inline boxShadow string, or Tailwind boxShadow config—or copy all three at once.

Advertisement

Frequently Asked Questions

How do I animate a box-shadow on hover?

Add transition: box-shadow on the base element and change the shadow in :hover. Keep the same number of layers between states for smoother repaints.

What is the difference between box-shadow and drop-shadow filter?

box-shadow follows the element's box. filter: drop-shadow() follows visible pixels—better for irregular shapes and transparent PNGs.

Can I use rgba() for the shadow color?

Yes—rgba black at roughly 0.06–0.20 opacity is common for natural elevation shadows.

Box shadow generator vs neumorphism generator?

This tool builds arbitrary multi-layer box-shadow stacks for any UI element. Neumorphism Generator focuses on soft dual-shadow presets on matching backgrounds—use it for tactile buttons; use this tool for general elevation, glow, and inset shadows.

Is Box Shadow Generator private on EverydayTools?

Yes—layer values and preview styling are computed locally in your browser. Settings are not uploaded to EverydayTools servers.

Privacy, accuracy, and trust

Privacy

Box-shadow layers and preview styling are computed locally; shadow settings are not sent to a server.

Accuracy

Always verify in target browsers; GPU cost rises with large blur on big elements.

For design and prototyping—not a substitute for design-system tokens in production.

Advertisement

Reviewed by EverydayTools Editorial Team on 2026-07-07.

Same workflow or intent — pick the next step without leaving the site.