CSS box-shadow generator
This tool builds a CSS box-shadow visually and gives you the exact value to paste into your stylesheet. It is for developers styling buttons, cards, modals and inputs who want a precise shadow without trial-and-error. The live preview shows the shadow on a sample box as you adjust each control.
How it works
The box-shadow property follows the order [inset] offset-x offset-y blur-radius spread-radius colour. The generator reads your sliders and assembles that string: offset X and Y position the shadow, blur softens its edge, and spread expands (positive) or contracts (negative) it. Your hex colour and opacity slider are combined into an rgba() value so the shadow can be semi-transparent, and ticking inset prepends the inset keyword to draw the shadow inside the element.
Example
With offset X = 0px, offset Y = 8px, blur = 24px, spread = -4px, colour #0f172a and opacity 25%, the tool outputs:
box-shadow: 0px 8px 24px -4px rgba(15, 23, 42, 0.25);
That is a soft, downward elevation shadow typical of cards. Tick inset and it becomes inset 0px 8px 24px -4px rgba(15, 23, 42, 0.25), an inner shadow instead.
| Effect | Offset Y | Blur | Spread |
|---|---|---|---|
| Subtle card | 4px | 12px | 0px |
| Floating elevation | 8px | 24px | -4px |
| Hard drop shadow | 6px | 0px | 0px |
| Pressed (inset) | 2px | 6px | 0px |
The shadow value is generated locally in your browser — nothing is uploaded.