CSS Box Shadow Generator: Tailwind, Neumorphism & Glass
Create CSS box shadows with a live preview and ready-made presets, or switch to neumorphism and glassmorphism. Copy as CSS, a Tailwind class or a variable.
Updated November 2026
Reviewed by Rafael Duarte
box-shadow: 10px 10px 20px 0px rgba(30, 41, 59, 0.15);
shadow-[10px_10px_20px_0px_rgba(30,_41,_59,_0.15)]
--shadow: 10px 10px 20px 0px rgba(30, 41, 59, 0.15);
Shift+Enter copies CSS
How the CSS box shadow generator works
Visual sliders, three output formats
1. Adjust the sliders
Shift X, Shift Y, Blur, Spread and Opacity — the preview updates live as you drag.
2. Pick a mode or preset
Standard, Neumorphism, Glassmorphism — or click a ready-made preset from the gallery.
3. Copy CSS, Tailwind or a variable
Shift+Enter copies the CSS instantly from anywhere in the tool.
What this box shadow generator does
Three shadow styles in one generator
Automatic neumorphism
Calculates the two opposing shadows (highlight + shade) from whatever background color you choose.
Glassmorphism in context
Renders the preview over a colored gradient, including the -webkit- prefix Safari needs.
Triple export
Plain CSS, a Tailwind utility class, or a CSS custom property — copy whichever format your project uses.
Material Design presets
Ready-made elevation levels, plus iOS-style shadows, subtle cards and neon glows.
Dark preview in Standard mode
In Standard mode, the moon button swaps the preview to a dark background so you can check how a shadow reads on a dark UI. Neumorphism uses your chosen background and Glassmorphism its own gradient.
Four preview shapes
Test the same shadow on a card, a button, an input field or a circle before you copy it.
CSS box-shadow examples
Common values you can copy straight into your stylesheet
When you'll reach for this tool
The most common scenarios among people who use it
Material Design-style elevation
Start from a Material or Cards preset. Most of them stack a tight shadow and a diffuse one, which gives cards and surfaces a more realistic sense of depth.
Neon effect on buttons and badges
Zero offset with a high blur produces an ambient glow instead of a directional shadow.
Soft UI (neumorphism)
Cards and buttons with a soft, extruded look. Flat raises the element, Pressed sinks it with inset shadows, and Concave keeps the Flat shadows but fills the element with a subtle gradient.
Frosted glass cards
Glassmorphism over a colored background or image, with the correct fallback for Safari.
Common mistakes
Using box-shadow instead of drop-shadow for icons
box-shadow follows the element's rectangular box; drop-shadow traces the actual visual shape, including transparent PNGs.
Forgetting the -webkit-backdrop-filter prefix
Without it, the glassmorphism effect silently disappears on iOS and macOS Safari.
Animating box-shadow directly on hover
Triggers a repaint on every frame — animate opacity on a pseudo-element that already has the shadow applied instead.
Why use this box shadow generator
Standard shadows, neumorphism and glassmorphism live on one screen, with the same live preview and the same three export formats: plain CSS, a Tailwind class and a CSS variable. In Neumorphism mode you pick a background color and the tool derives the light and dark shadows from it.
The CSS it outputs is production-ready, with compatibility prefixes like -webkit-backdrop-filter already included.
box-shadow vs. filter: drop-shadow
Two ways to add a shadow, different purposes
Frequently asked questions
It adds one or more shadow effects around an element's box — horizontal offset, vertical offset, blur, spread and color. Multiple shadows stack when separated by commas, with the first one rendered on top.
box-shadow applies to the element's rectangular box, including transparent areas. filter: drop-shadow follows the actual visual shape — on a transparent PNG, it hugs the visible pixels instead of the bounding box.
Separate the values with commas: box-shadow: shadow1, shadow2. The first shadow listed renders on top, and this layering is the technique behind Material Design's elevation system. The sliders here edit a single layer. Two-layer presets such as Material E2 or Card MD are applied and copied whole, but as soon as you move a slider the shadow goes back to one layer.
For anything beyond the built-in shadow-sm to shadow-2xl scale, use an arbitrary value with underscores in place of spaces, like shadow-[0_4px_14px_rgba(0,0,0,0.15)]. The Tailwind Utility output builds that class for you. In Neumorphism mode it adds the background class too, and in Glassmorphism mode the background, backdrop blur and border classes.
Static shadows don't affect layout since box-shadow doesn't take up space in the document flow. Animating it on hover does hurt performance though, since it triggers a repaint every frame — animate opacity on a pseudo-element with the shadow already applied instead.
Use zero horizontal/vertical offset, zero spread and a high blur radius with a vivid color: box-shadow: 0 0 20px rgba(99, 102, 241, 0.7). Stack two glows with different blur radii for extra intensity.
Apply two box shadows to an element whose background matches its parent: a light shadow offset up-left and a dark shadow offset down-right, both with a soft blur. This tool calculates both values automatically from your background color.
References
Related Tools
- Color Contrast Checker: WCAG AA/AAA & Color Blindness Design Check if text and background pass WCAG 2.2 AA and AAA, get the nearest passing text color and preview 4 types of color blindness. Free, in your browser.
- HEX to RGB Converter with HSL & CMYK Values Design Paste a HEX code and copy its RGB, HSL and CMYK values instantly, with 4 harmony colors, a contrast check against white and CSS palette export.
- Color Scheme Generator: Complementary, Triadic & Analogous Design Pick a base color and get 5 harmonious colors: analogous, monochromatic, complementary, triadic or tetradic. Preview them on a site, export CSS or JSON.
- Color Palette from Image: Extract HEX, RGB & HSL Codes Design Upload a photo or logo and extract 3 to 12 dominant colors as HEX, RGB and HSL. Export CSS variables, Tailwind, JSON or PNG. Nothing leaves your browser.
- Flexbox Generator: CSS, Tailwind & React Code Design Build flex layouts with a live preview and 11 presets, set grow, shrink and order per item, then copy the code as CSS, Tailwind classes or React styles.