Hero Background

Next-Gen App & Browser Testing Cloud

Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles

Next-Gen App & Browser Testing Cloud

CSS Box Shadow Generator - TestMu AI (Formerly LambdaTest)

Craft CSS box-shadow code visually with controls for offset, blur, spread, color, and inset. Layer multiple shadows for realistic depth and copy the box-shadow value right in your browser.

%
px
px
px
px

Effect Gallery

Object
Background
Preview
box-shadow: 10px 10px 18px 0px rgba(0, 0, 0, 0.35); -webkit-box-shadow: 10px 10px 18px 0px rgba(0, 0, 0, 0.35); -moz-box-shadow: 10px 10px 18px 0px rgba(0, 0, 0, 0.35);

The CSS Box Shadow Generator lets you craft shadows visually and copy the box-shadow code without trial and error in your editor. Drag the offset, blur, spread, and color controls, layer several shadows for realistic depth, and watch the preview update before you copy. It is built for front-end developers and designers who want clean, consistent shadows on cards, buttons, and other UI elements. Everything runs in your browser, so there is nothing to install and nothing to upload.

What is the Box Shadow Generator?

The Box Shadow Generator is a free online tool that produces CSS for the box-shadow property. box-shadow casts a shadow around an element's box, which makes it the standard way to give cards, buttons, modals, and inputs a sense of elevation. Because it follows the element's box and border-radius, it works perfectly for the rounded rectangles that make up most interfaces.

The tool exposes every part of the property through controls. You set the horizontal and vertical offset to choose the shadow's direction, blur to soften its edge, spread to size it, and a color with opacity. An inset toggle moves the shadow inside the element for a pressed effect, and you can stack several shadows to build depth.

How to use the Box Shadow Generator?

You can design a polished shadow in well under a minute. Follow these steps:

  • Set the offsets: Adjust the horizontal and vertical offset to set the direction the shadow falls from the element.
  • Adjust blur and spread: Increase blur to soften the shadow edge and spread to grow or shrink the overall shadow size.
  • Pick a color and inset: Choose the shadow color and opacity, and toggle inset to push the shadow inside the element for a pressed look.
  • Copy the CSS: Copy the generated box-shadow value, including any layered shadows, and paste it into your stylesheet.

Box-shadow properties explained

Each value in a box-shadow declaration changes the look in a specific way. Here is what the controls do:

  • Horizontal and Vertical Offset: Move the shadow left, right, up, or down relative to the element to set its direction.
  • Blur Radius: Softens the shadow edge, where larger values create a more diffuse, gentle shadow.
  • Spread Radius: Grows the shadow with positive values or tightens it with negative values, before blur is applied.
  • Color and Opacity: Sets the shadow tone, where a semi-transparent dark color usually looks the most natural.
  • Inset: Draws the shadow inside the element to create a recessed or pressed appearance.
  • Layered Shadows: Combine several comma-separated shadows to build realistic, multi-step depth from one property.

Box-shadow vs drop-shadow

These two are easy to confuse, but they shadow elements in fundamentally different ways. This page focuses on box-shadow; the table shows when it is the right pick:

Aspectbox-shadowfilter: drop-shadow()
What it shadowsThe rectangular box of the elementThe visible, non-transparent shape
TransparencyIgnored, shadows the whole boxRespected, follows the alpha edges
Inset supportYes, with the inset keywordNo inset option
Best forCards, buttons, inputs, modalsTransparent PNGs, SVG icons, logos
Border-radiusFollows rounded cornersFollows the content shape directly

If your element is a transparent image or an irregular icon, reach for the Drop Shadow Generator instead, which follows the actual shape of the content.

Use cases of box-shadow

box-shadow is one of the most-used properties in interface design. These are the effects it handles best:

  • Card Elevation: Lift cards off the background with a soft shadow so content groups read as distinct surfaces.
  • Button Depth and Pressed States: Use outer shadows for raised buttons and inset shadows for pressed or active states.
  • Focus and Glow Rings: Create accessible focus rings or glowing highlights with a blurred, spread shadow and no offset.
  • Soft UI Surfaces: Pair layered shadows with the Neumorphism Generator for soft UI, and use the Flexbox Generator to arrange the shadowed components.

This tool is maintained by TestMu AI (formerly LambdaTest), the team behind a unified testing platform, so it is built with consistent cross-browser shadow rendering in mind.

Frequently Asked Questions (FAQs)

What is CSS box-shadow?

box-shadow is a CSS property that casts a shadow around an element's rectangular box. You control the horizontal and vertical offset, blur, spread, and color, and you can add an inset keyword to draw the shadow inside the element instead.

How do I add multiple box-shadows to one element?

List several shadow values separated by commas in a single box-shadow declaration. The browser stacks them in order, which lets you layer soft and sharp shadows to create realistic depth from one property.

What is the difference between box-shadow and drop-shadow?

box-shadow shadows the element's rectangular box and ignores transparency, which suits cards and buttons. filter drop-shadow follows the visible shape of the content, which suits transparent PNGs and SVG icons. Choose by whether your element is a solid box or an irregular shape.

Can box-shadow work with border-radius?

Yes. box-shadow follows the element's border-radius, so a rounded element casts a rounded shadow. This is why box-shadow is a good fit for cards and pill buttons that already use rounded corners.

How do I create a glow effect with box-shadow?

Use a zero or small offset, a large blur, no spread, and a bright color. Because the shadow spreads evenly around the element with no directional offset, it reads as a soft glow rather than a cast shadow.

What does the spread value do?

Spread grows or shrinks the shadow before blur is applied. A positive spread makes the shadow larger than the element, while a negative spread pulls it in, which is useful for tight, subtle shadows under cards.

Do many box-shadows affect performance?

Static shadows are inexpensive, but animating large or numerous shadows can trigger repeated repaints. For smooth animation, prefer transform and opacity, and keep animated shadows small and few to avoid jank on lower-powered devices.

Is the box shadow generator free?

Yes, it is free with no signup and no limit. You can build and copy as many shadows as you need. The tool runs in your browser and is maintained by TestMu AI (formerly LambdaTest).

Did you find this page helpful?

ShadowLT Logo

Start your journey with TestMu AI

Get 100 minutes of automation test minutes FREE!!