About the Box Shadow Generator tool
A good shadow makes an interface feel tactile. Cards seem to lift off the page, buttons look pressable and modals stand out from the content behind them. Getting that effect right with the CSS box-shadow property, though, means juggling five numbers and a colour, and the nicest shadows usually combine several layers. This box shadow generator lets you shape all of it with sliders and see the result immediately.
Each shadow layer has its own horizontal and vertical offset, blur radius, spread radius, colour, opacity and an inset switch for inner shadows. Add as many layers as you need, duplicate one to fine-tune a variation, and stack a sharp close shadow with a soft distant one for realistic depth. The preview box and its background colours are adjustable, so you can judge the shadow on a white card, a dark theme or a soft neumorphic surface.
Presets cover popular looks such as soft elevation, Material-style depth, layered shadows, hard retro offsets, coloured glows, inset wells and neumorphism. When you are happy, copy the ready CSS. Nothing is uploaded; the tool runs entirely in your browser.
How to use Box Shadow Generator
- Start with the default soft shadow or click a preset such as Layered, Glow or Neumorphic.
- Adjust the horizontal and vertical offset, blur radius, spread radius and opacity sliders for the selected layer.
- Pick a shadow colour and switch on “Inset” for an inner shadow.
- Click “Add layer” to stack another shadow, or use the duplicate button, and select layers by their tabs.
- Change the preview box and background colours to test contrast, then click “Copy” under CSS code.
Features
Unlimited shadow layers
Combine several shadows in one declaration for natural, soft depth.
Full control of every value
X and Y offset, blur, spread, colour, opacity and inset are all adjustable per layer.
Realistic preview
Change the box colour, corner radius and page background to see the shadow in context.
Seven ready presets
Soft, Material, Layered, Hard, Glow, Inset and Neumorphic styles in one click.
Copy-ready CSS
Outputs box-shadow with rgba colours, plus a -webkit- line for older WebKit browsers.
When to use it
- Give product cards a subtle lift on an e-commerce listing page.
- Create a hover state where a button’s shadow grows to feel clickable.
- Build a neumorphic dashboard widget with light and dark twin shadows.
- Add an inner shadow to an input field so it looks recessed.
- Create a coloured glow around a highlighted pricing plan.
- Recreate a shadow from a Figma or Adobe XD mockup by matching its offset, blur and opacity values.
Frequently asked questions
What is the difference between blur and spread?
Blur softens the edge of the shadow; larger values make it more diffuse. Spread grows or shrinks the shadow’s size before blurring, and negative spread keeps a blurred shadow tucked under the element.
How do I create an inner shadow?
Switch on the Inset option for a layer. The shadow is then drawn inside the element’s border instead of outside.
Why use more than one shadow layer?
Real light creates both a crisp shadow near an object and a soft one further away. Stacking two or three low-opacity layers mimics this and looks more natural than one heavy shadow.
Do box shadows affect performance?
Static shadows are cheap. Very large blur values animated on many elements can slow down scrolling on low-end phones, so animate opacity or transform instead where possible.
Can I apply a shadow to text or a transparent PNG?
box-shadow always follows the element’s rectangular box. For text use the text-shadow property, and for the outline of a transparent image use filter: drop-shadow() instead.
Does box-shadow follow rounded corners?
Yes. The shadow takes the element’s border-radius into account, which you can test with the corner radius slider in the preview.