Developer Tools guide
Box Shadow Generator Guide
This page holds the detailed reference that supports the focused interactive tool.
Open the Box Shadow GeneratorHow CSS box-shadow works
CSS box-shadow uses horizontal offset, vertical offset, blur radius, spread radius, color, and an optional inset keyword. Small layered shadows usually look more natural than one oversized shadow.
How to use this tool
- Start from a preset or tune the X, Y, blur, spread, color, and opacity controls.
- Add a second layer when one shadow looks too flat or too harsh.
- Copy CSS, Tailwind-style output, or a CSS variable for your component.
Real examples
- Soft card: low opacity, medium blur, negative spread.
- Floating modal: larger Y offset and a broad second layer.
- Inset input: enable inset for a pressed or recessed surface.
Common use cases
- Create reusable card elevation tokens for a design system.
- Preview a hover shadow before shipping a button or menu.
- Convert visual shadow tuning into copy-ready CSS variables.
Use layered shadows
Pair a small close shadow with a larger soft shadow to create depth without making the card look dirty or heavy.
Control the spread
Negative spread tightens the shadow and keeps it from bleeding too far. Positive spread makes the shape feel larger.
Match the background
A shadow that works on a light canvas may feel too weak on a dark canvas. Test the same shadow on your real UI background.
Sample input/output
- Input: Y
20px, blur48px, spread-18px, opacity35%. - Output:
box-shadow: 0 20px 48px -18px rgba(15, 23, 42, .35); - Use: apply it to cards, modals, popovers, or image containers.
Common errors and fixes
- Shadow looks muddy: lower opacity or use negative spread.
- Shadow is clipped: check parent
overflow: hiddenand spacing. - Tailwind value is hard to read: keep complex layers in a CSS variable.
Edge cases / errors
- Inset shadows render inside the element, not outside it.
- Large blur values can be expensive on very large animated elements.
- Dark UI often needs lighter, lower-opacity shadows plus borders.
Edge cases table
| Recipe | Good for | Adjustment |
|---|---|---|
| Soft card | Dashboards, settings panels, article cards. | Use medium blur, low opacity, and negative spread. |
| Floating modal | Dialogs, popovers, dropdown menus. | Add a wide second layer and increase Y offset. |
| Inset control | Inputs, toggles, pressed buttons. | Enable inset and keep blur small. |
| Dark mode card | Interfaces on dark backgrounds. | Pair subtle shadow with a visible border or highlight. |
Related workflow
Tune component shadows here, then check foreground and background pairs with Color Contrast Checker, format design token JSON with JSON Formatter, and convert token spreadsheets with CSV to JSON Converter before moving values into a component library.
Box shadow FAQ
What is a box shadow generator?
A box shadow generator lets you visually adjust CSS shadow values and copy the final box-shadow code for your website.
Can I use multiple box shadows?
Yes. CSS supports multiple shadows separated by commas. Multi-layer shadows are useful for realistic elevation.
What does inset do?
inset turns the shadow inward, which is useful for pressed buttons, input fields, and carved surfaces.
Does Tailwind support custom shadows?
Yes. You can use arbitrary values or define named shadows in your Tailwind config. For complex multi-layer shadows, CSS variables are often cleaner.
Does this tool save or upload my design?
No. The preview and code generation run locally in your browser.
Which shadow is best for cards?
Start with a soft shadow using low opacity, medium blur, and negative spread. Then adjust based on the background color.
More developer tools
Color Contrast Checker
Check WCAG contrast ratios before pairing shadows with foreground text.
JSON Formatter / Validator
Format design-token JSON before copying values into a frontend project.
CSV to JSON Converter
Turn design token spreadsheets into structured JSON for review.
Regex Tester
Test class-name, data-attribute, or token naming patterns locally.