Presets
box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.2);
How to use
Start from a preset or a palette
Click a preset such as Card, Modal or Neon, or open Elevation palette to build low, medium and high shadows from a light position, strength and crispness. Set Page background, Box color and radius to match your design.
Tune each layer
Drag X offset, Y offset, Blur, Spread and Opacity, pick a Shadow color and switch Inset on for inner shadows. Use the layer buttons to hide, move, duplicate or remove layers, up to ten in total.
Copy the code
Pick CSS, Tailwind, SCSS, With -webkit- or Hover state and press Copy, or download a .css file. Copy share link keeps the layers and colors in a URL.
Why CSS Box Shadow Generator
- Up to ten layers with offset, blur, spread, color, opacity and inset, plus reorder and hide.
- 23 presets and an elevation palette that writes low, medium and high CSS variables.
- Preview on a box, card, button or avatar with your own colors and a hover lift.
- CSS, Tailwind, SCSS, prefixed and hover-state output, with share links.
box-shadow syntax, value by value
Each layer is a list of values separated by spaces, and layers are separated by commas. The tool always writes the full form so every value is visible.
In your own CSS you can leave out spread, or both blur and spread, and they default to 0. The color can also be left out, in which case the browser uses the element's text color. The first layer in a list is painted on top of the ones after it.
| Part | Example | What it does |
|---|---|---|
| inset (optional) | inset | Draws the shadow inside the element |
| X offset | 0px | Moves the shadow right (positive) or left (negative) |
| Y offset | 4px | Moves the shadow down (positive) or up (negative) |
| Blur | 12px | How soft the edge is; 0 gives a hard edge |
| Spread | -2px | Grows or shrinks the shadow before blurring |
| Color | rgba(0, 0, 0, 0.2) | Shadow color; the alpha sets how dark it is |
Copy-ready box shadow recipes
These are the values behind some of the presets. The tool writes 0 without a unit, so its output is slightly shorter. Paste any of them after box-shadow: in your CSS.
| Use | Value |
|---|---|
| Subtle | 0px 1px 2px 0px rgba(0, 0, 0, 0.05) |
| Card | 0px 1px 3px 0px rgba(0, 0, 0, 0.1), 0px 1px 2px -1px rgba(0, 0, 0, 0.1) |
| Dropdown | 0px 4px 6px -1px rgba(0, 0, 0, 0.1), 0px 2px 4px -2px rgba(0, 0, 0, 0.1) |
| Popover | 0px 10px 15px -3px rgba(0, 0, 0, 0.1), 0px 4px 6px -4px rgba(0, 0, 0, 0.1) |
| Modal | 0px 20px 25px -5px rgba(0, 0, 0, 0.1), 0px 8px 10px -6px rgba(0, 0, 0, 0.1) |
| Deep | 0px 25px 50px -12px rgba(0, 0, 0, 0.25) |
| Inner | inset 0px 2px 4px 0px rgba(0, 0, 0, 0.15) |
| Focus ring | 0px 0px 0px 3px rgba(37, 99, 235, 0.5) |
| Glow | 0px 0px 24px 4px rgba(59, 130, 246, 0.6) |
| Material 1 | 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24) |