Γεννήτρια CSS Box-Shadow
ΝέοΔημιουργήστε πολυεπίπεδες σκιές CSS box-shadow με προεπιλογές και ζωντανή προεπισκόπηση. Αντιγράψτε άμεσα το CSS, την τιμή ή το στυλ React.
Select a layer above to edit it.
Runs entirely in your browser. Nothing is uploaded.
Build Any CSS Box-Shadow Visually — No Trial and Error
This free CSS box-shadow generator replaces tedious guesswork in your code editor with a live visual canvas. Adjust sliders for offset, blur, spread, and opacity — the shadow on the preview element updates in real time — and copy-ready CSS waits at the bottom in your choice of format. Nothing is uploaded, no account is needed, and every calculation runs locally in your browser.
Start from one of the eight built-in presets or from a blank layer. Add multiple shadow layers to build up realistic depth effects, toggle the dark/light background to check contrast, then choose your output format: full CSS property declaration, bare shadow value, or a React-ready camelCase inline style string. The generator covers everything from subtle card elevation to neumorphic extrusion to neon glow effects.
Understanding the Six Parameters of box-shadow
Offset X and Y position the shadow relative to the element — positive X moves it right, positive Y moves it down. Negative offsets move it left or up, useful for top-lit shadow effects. Blur radius controls edge softness: zero produces a hard, crisp outline; larger values create a gradual, diffuse fade that reads as natural depth. Spread radius expands or contracts the shadow before blur is applied — a negative spread with a large blur keeps the shadow within the element's natural footprint, the technique behind most realistic card shadows.
Color is typically a semi-transparent dark value like `rgba(0, 0, 0, 0.12)` for neutral elevation, or a vivid hue for glow effects. The opacity slider lets you fine-tune alpha independently of the colour picker. The Inset toggle reverses the shadow direction, drawing it inside the border box to create recessed wells, indented inputs, and push-button pressed states — capabilities that `filter: drop-shadow()` cannot replicate.
Multi-Layer Shadows for Professional, Realistic Depth
A single large shadow reads as artificial — it looks like a generic Photoshop drop-shadow filter rather than real light. Professional UI uses three to five stacked shadow layers where each roughly doubles the offset and blur while halving the opacity. This technique mimics how light physically scatters from a source and creates a shadow that reads as natural at any size or viewing distance.
This generator supports up to eight independent layers. Each layer has its own offset, blur, spread, color, opacity, and inset toggle. The eye icon on each layer lets you toggle visibility for instant before/after comparison without deleting the layer. The Deep preset shows a three-layer graduated stack; Floating uses two complementary layers to suggest the element is lifted above the page; Material reproduces Google Material Design's multi-layer elevation specification.
Presets: Card, Crisp, Neumorphic, Glow, and More
The Soft card preset produces a barely-visible elevation — just enough lift to separate a white card from the page without competing with its content. Crisp gives a zero-blur, hard-edged shadow popular in brutalist and retro design trends. Material reproduces Google Material Design's multi-layer shadow specification for apps with a familiar Android-style depth system.
Neumorphic combines a bright highlight on the top-left with a dark shadow on the bottom-right to make an element appear extruded from a matching surface. Glow Blue demonstrates how a zero-offset, coloured shadow creates a luminous button or hero accent — change the colour to match your brand. Inset Well shows the inset technique for recessed UI elements like text inputs and pressed states. Load any preset and adjust the sliders to push it exactly where your design needs it.
box-shadow vs filter: drop-shadow vs Figma Shadows — Which to Use?
box-shadow targets the element's rectangular border box. filter: drop-shadow() traces the element's alpha channel silhouette — correct for transparent PNGs and SVG cutouts but lacking inset support, spread radius, and multi-layer stacking. For every standard UI element (cards, buttons, modals, panels), `box-shadow` is the right tool.
Figma and Adobe XD both offer shadow design panels, but their outputs are design tool values — not always compatible with CSS without manual conversion. This generator produces valid, production-ready CSS directly, eliminating the translation step. Unlike Figma's limited free tier or Adobe XD's subscription model, UtiloKit is completely free, runs in any browser without installation, and produces multiple output formats (CSS, value, React) without requiring a design tool account.
Performance, Privacy, and Three Copy Formats
A static `box-shadow` is painted once and composited cheaply — no performance concern for most UI. Animating it directly triggers a repaint on every frame. The performant alternative: add a `::after` pseudo-element with the destination shadow already applied, then `transition: opacity` on that element. The GPU composites opacity without repainting the shadow, giving a smooth animation at zero repaint cost.
Once you've dialled in your shadow, copy in the format your project needs: CSS property for stylesheets, value only for CSS variables or SCSS maps, or React inline style for JSX `style` props and Styled Components. Your configuration is never saved to a server or sent anywhere — close the tab and it's gone. Bookmark the page and return whenever you need to iterate on a shadow design.
Works on Desktop, iPhone, Android, and Every Modern Browser
The box-shadow generator is fully responsive and works on any device with a modern browser. On desktop, you get a three-column layout with the layer stack on the left, the live preview in the centre, and generated code on the right. On iPhone and Android, the layout collapses to a vertical stack with touch-optimised sliders and color pickers that use the native system color picker.
All copy buttons use the Web Clipboard API supported by Safari 13.1+, Chrome 66+, Firefox 90+, and Edge 79+ — meaning copy functionality works on modern mobile browsers without any workaround. No app download, no account creation, no rate limits. Open the URL on any device and start designing immediately.
The CSS box-shadow Five-Value Syntax, Fully Explained
The complete box-shadow syntax is: [inset] offset-x offset-y [blur-radius] [spread-radius] color. Only the two offsets and the color are required; blur and spread default to zero. Offset-X and offset-Y follow the CSS coordinate system whose origin is the top-left corner of the viewport: a positive offset-x moves the shadow to the right, a negative value to the left; a positive offset-y moves the shadow downward, a negative value upward. This means a shadow at 4px 8px sits below and to the right of the element — matching the convention of a light source above and to the left.
Blur-radius cannot be negative. At zero the shadow has a perfectly hard edge identical in shape to the element's border box — any value above zero applies a Gaussian blur to a solid silhouette of that box, so increasing blur widens and softens the fade. Spread-radius expands or shrinks the shadow outline before the blur is applied: a positive value makes the shadow larger than the element, a negative value contracts it. Setting offset-x: 0, offset-y: 0, blur: 0, and a positive spread produces a uniform solid border with no blur — a quick CSS alternative to outline or an extra wrapper element.
The optional inset keyword placed before the offsets switches the shadow from an outer drop shadow to an inner shadow drawn against the inside of the element's border box. The offset direction flips intuitively: a positive offset-y pushes the inner shadow down from the top edge, creating the appearance of a recessed cavity lit from above. Finally, any number of shadows can be stacked as a comma-separated list. The browser renders them in declaration order with the first shadow painted on top — so in a two-shadow neumorphic rule the highlight should come first (visually in front) and the darker shadow second. This ordering is the opposite of z-index stacking, which often trips up developers new to multi-layer shadows.
box-shadow vs filter: drop-shadow() — Choosing the Right Tool
The key difference between box-shadow and filter: drop-shadow() is what they shadow. box-shadow always shadows the element's rectangular border box — the layout rectangle defined by its width, height, padding, and border — regardless of what the element visually looks like. A PNG image with transparent corners gets a rectangular shadow that cuts across those transparent areas. filter: drop-shadow(), by contrast, traces the element's alpha channel silhouette: it follows the actual opaque pixels, so a transparent PNG cutout of a star gets a star-shaped shadow, and an SVG with cutout areas is shadowed around its real visible shape.
The performance characteristics differ as well. box-shadow is resolved during the browser's compositing step and is typically GPU-accelerated: the shadow is computed once and combined with the element's layer cheaply. filter: drop-shadow() may trigger the creation of a new stacking context and requires a pixel-level alpha-channel pass over the element's rendered content, which can be slower — especially when the element contains many child nodes. Modern browsers (Chromium 100+, Firefox 110+, Safari 16+) have improved filter acceleration significantly, but for animated shadows on complex components, box-shadow remains the lower-risk choice.
filter: drop-shadow() accepts only three positional values (offset-x offset-y blur-radius) plus a color — it has no equivalent to spread-radius and it does not support the inset keyword. Multiple filter shadows require chaining multiple drop-shadow() functions inside the same filter declaration, which is syntactically less clean than a comma list. The practical rule: use box-shadow for every standard UI component — cards, buttons, modals, tooltips, panels — and reserve filter: drop-shadow() exclusively for images with meaningful transparency, SVG icons, and irregularly-shaped decorative elements where the rectangular fallback would look obviously wrong.
Elevation Systems and Material Design's Dual-Shadow Approach
Google Material Design formalised shadow as a semantic elevation system rather than a purely decorative property. Every component has a resting elevation measured in density-independent pixels (dp) — a physical size unit that remains constant across screen densities. A flat surface sits at 0 dp; a raised button rests at 2 dp and lifts to 8 dp on hover; a dialog sits at 24 dp permanently. Elevation communicates interactivity: elements that react to touch or cursor hover rise visually when activated, giving users a tactile cue that input has been registered before any other state change occurs.
Material Design achieves realistic shadows by layering two simultaneous box-shadow declarations per elevation level — one for the key light (a directional source above and slightly in front of the surface, producing a crisp shadow with a moderate y-offset and high blur) and one for the ambient light (diffuse light from all directions, producing a softer, lower-opacity shadow with minimal offset and a smaller blur). At elevation 6dp, for example, the key-light shadow is approximately 0 3px 5px rgba(0,0,0,0.2) and the ambient shadow is 0 1px 18px rgba(0,0,0,0.12). The combination reads as three-dimensional in a way no single-layer shadow can match, because real objects are illuminated by both point sources and environmental bounce.
Independent of Material Design, designer Josh Comeau popularised two refinements that apply to any shadow system. First, tinting shadows with the background colour rather than using pure rgba(0,0,0,X): on a warm cream background, a shadow with a slight warm hue looks physically grounded, whereas a neutral-grey shadow looks pasted-on. Second, the smooth shadow technique — stacking five or six layers whose blur and offset values follow an easing curve (such as cubic-ease-in from a tiny value to a large one) rather than linear steps. The result passes the squint test: at any viewing distance the gradient of darkness around the element feels continuous rather than banded, which is what separates professional UI from generic web-app elevation.
Frequently asked questions
What is CSS box-shadow and what does it do?
The CSS `box-shadow` property adds one or more shadow effects to an HTML element. Each shadow is defined by up to six values: an optional `inset` keyword, a horizontal offset, a vertical offset, a blur radius, a spread radius, and a color. Positive horizontal offsets push the shadow right; positive vertical offsets push it down. Multiple shadows are comma-separated and rendered front-to-back. It is the primary CSS mechanism for adding visual depth, elevation hierarchy, glow effects, and neumorphic styling to UI components without any images.
What is the correct CSS box-shadow syntax?
The full syntax is: `box-shadow: [inset] offset-x offset-y [blur-radius] [spread-radius] color`. Only `offset-x`, `offset-y`, and `color` are required; `blur-radius` and `spread-radius` default to 0 if omitted, and `inset` defaults to outer shadow. A typical card shadow looks like: `box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.12)`. Stack unlimited shadows by separating them with commas — they render front-to-back (first listed is on top). This generator outputs the full declaration including the `box-shadow:` property name, or just the value if you prefer.
What is the difference between blur-radius and spread-radius?
Blur-radius controls edge softness: zero gives a hard, crisp edge that matches the element shape exactly; larger values create a progressively softer, more diffuse fade. Spread-radius grows or shrinks the entire shadow before the blur is applied: positive values expand it past the element's boundary, negative values contract it inward. The most realistic-looking shadows use a moderate blur with a slightly negative spread, keeping the shadow close to the element's footprint rather than spreading too far. This is the technique used in the Deep and Floating presets.
How do I create an inset box-shadow in CSS?
Add the `inset` keyword at the start of the shadow declaration: `box-shadow: inset 0px 2px 6px rgba(0, 0, 0, 0.20)`. An inset shadow is drawn inside the element's border box rather than behind it, creating a recessed or pressed-in appearance. Common uses include: input fields (showing focus depth), toggle switch tracks, push-button active states, and embossed text containers. This generator has an Inset toggle in every layer's control panel — enable it and the shadow immediately flips inside the preview element.
Can I stack multiple box-shadows on one element?
Yes — CSS allows any number of comma-separated shadows on a single element. They render in the order listed, with the first shadow on top. Stacking multiple layers is the key technique for smooth, realistic depth — a single large shadow looks artificial, while three to five graduated layers mimic how light physically scatters. This generator supports up to eight independent layers, each with its own offset, blur, spread, color, opacity, and inset toggle. An eye icon lets you show/hide individual layers for quick before/after comparison without deleting them.
How do I create a neumorphic shadow?
Neumorphism uses two opposing shadows on an element whose background colour matches the page: one bright (near-white) shadow pointing top-left, one dark (black at low opacity) pointing bottom-right. This makes the element appear extruded from the background surface. A classic neumorphic declaration: `box-shadow: -6px -6px 12px rgba(255,255,255,0.8), 6px 6px 12px rgba(0,0,0,0.15)`. The element's background must match the page background exactly for the illusion to work. The Neumorphic preset in this generator provides a ready-made starting point — switch the preview background to 'Soft grey' to see it in context.
How do I make a glowing box-shadow effect?
Use zero offset, a large blur radius, and a coloured value: `box-shadow: 0px 0px 20px 4px rgba(59, 130, 246, 0.5)`. Zero offset makes the glow radiate evenly in all directions. A positive spread pushes the glow further from the element. Combining two layers — one with a smaller blur and higher opacity for a bright core, and one with a large blur and lower opacity for the ambient halo — produces a more convincing luminous effect. The Glow Blue preset demonstrates this with a two-layer approach. Change the colour to any hue for custom accent glows.
How do I create a smooth, realistic layered shadow?
Instead of one large shadow, stack three to five layers where each roughly doubles the offset and blur while halving the opacity: for example, `0px 1px 2px rgba(0,0,0,0.06), 0px 4px 8px rgba(0,0,0,0.08), 0px 12px 24px rgba(0,0,0,0.06)`. This technique mimics how light physically scatters from a point source and remains convincing at any zoom level or display resolution. The Deep and Floating presets in this generator are built on exactly this principle — three graduated layers that read as natural at any scale.
What is the difference between box-shadow and filter: drop-shadow()?
`box-shadow` always follows the element's rectangular border box, regardless of what the element looks like visually. `filter: drop-shadow()` traces the element's actual alpha channel silhouette — useful for transparent PNG cutouts or SVG icons where you want the shadow to follow the shape rather than its bounding rectangle. For standard UI components (cards, buttons, panels, dialogs), `box-shadow` is correct: it is faster to paint, supports inset mode, accepts spread radius, and allows multiple stacked layers. Use `filter: drop-shadow()` only when the element's transparent background matters for the shadow shape.
Does box-shadow affect CSS layout or click areas?
No. `box-shadow` is purely a visual effect rendered outside normal layout flow. It never pushes sibling elements, never increases the scrollable content area, and has no effect on the element's computed width, height, margin, or padding. Shadows extend visually beyond the element's box but are ignored by the layout engine. This means you can add generous shadows to a tightly-packed grid without breaking the layout — though you may want to add `overflow: visible` on the parent container to ensure the shadow isn't clipped.
How do I copy the generated CSS in React or Tailwind format?
Once you've built your shadow, the generator offers three output formats. <strong>Copy CSS</strong> gives the full property declaration (`box-shadow: …;`) ready for any stylesheet. <strong>Copy value</strong> gives just the shadow value — useful as a SCSS variable, CSS custom property value, or Tailwind `extend.boxShadow` entry. <strong>React style</strong> outputs camelCase format (`boxShadow: '…'`) for JSX inline style objects or Styled Components. For Tailwind, paste the value into your `tailwind.config.js` under `theme.extend.boxShadow` to create a custom shadow utility class.
Is this box-shadow generator better than cssgenerator.org or css-box-shadow.com?
Most dedicated box-shadow tools offer single-layer generation only — cssgenerator.org, for example, provides basic controls but no preset library and no multi-layer stacking. css-tricks.com's reference is documentation, not an interactive tool. CSS Generators at cssmatic.com are functional but dated and ad-heavy. UtiloKit's generator supports up to eight independent layers with per-layer eye toggles, eight curated presets covering the most common shadow design patterns (card, crisp, material, neumorphic, floating, deep, glow, inset well), three output formats for different frameworks, and a full dark/light background toggle for contrast checking — all ad-free with zero data upload.
Does this tool work on mobile — iPhone and Android?
Yes — the box-shadow generator is fully responsive. On iPhone and Android, all sliders are touch-friendly with appropriately sized drag handles. The live preview element scales to fit mobile screens. Color pickers use the native system color picker on mobile browsers. The three-column desktop layout collapses to a clean single-column vertical layout on narrow screens. All copy buttons use the Web Clipboard API, which is supported on Safari, Chrome, and Firefox on both iOS and Android. No app download is required, no account needed — open the URL and start building.
Related tools
Προβολή όλων των εργαλείωνΓεννήτρια Cubic Bezier
Σχεδιάστε μια καμπύλη easing CSS σύροντας σημεία ελέγχου, με ζωντανή προεπισκόπηση.
Γεννήτρια Border Radius
Σχεδιάστε οπτικά στρογγυλεμένες γωνίες CSS και οργανικά σχήματα blob.
Παιχνιδότοπος CSS Flexbox
Ρυθμίστε τις ιδιότητες flex με ζωντανή προεπισκόπηση και αντιγράψτε το CSS.
Παιχνιδότοπος CSS Grid
Ρυθμίστε στήλες, κενά και στοίχιση του grid με ζωντανή προεπισκόπηση και CSS.
Γεννήτρια Glassmorphism
Σχεδιάστε μια κάρτα από θαμπό γυαλί και αντιγράψτε το CSS, με ζωντανή προεπισκόπηση.
Γεννήτρια CSS Text-Shadow
Ρυθμίστε μια σκιά κειμένου CSS με ζωντανή προεπισκόπηση και αντιγράψτε τον κώδικα.