CSS Box Shadow and Inset Shadow Generator

Adjust shadow controls, preview the result, and copy CSS box-shadow code for cards, buttons, panels, and UI mockups.

box shadowCSSPreview
Adjust controls to generate CSS.

What the CSV showed

The keyword export included box shadow generator, plus related searches around shadow styling for interface components. This browser tool focuses on standard CSS box-shadow because it is the intent most useful for a static web utility. It gives designers and developers a fast preview loop before copying a value into a card, button, dropdown, modal, or dashboard panel.

How to use shadows well

Keep UI shadows subtle. Large blur, low opacity, and a small vertical offset usually feel more polished than heavy black edges. Use stronger shadows for floating menus and lighter shadows for cards. If every component has a heavy shadow, nothing feels elevated; the page simply looks noisy.

Think of shadows as hierarchy. A page card might use a soft shadow or no shadow at all. A dropdown can use a stronger shadow because it floats above the page and needs separation. A modal can use the strongest shadow because it temporarily becomes the most important surface.

Choosing shadow values

The X offset controls left and right movement, while the Y offset controls vertical direction. The blur value softens the edge, and spread changes the size of the shadow before blur is applied. Opacity usually matters more than color. A black shadow at low opacity often looks cleaner than a saturated brand-color shadow, but a tinted shadow can work for playful UI or branded highlights.

Inset shadows are useful for pressed states, recessed panels, form fields, and small controls. Use them sparingly because they can make components feel disabled or sunken if the contrast is too strong.

Copying into projects

After copying the CSS, test it against the real component background. A shadow that looks good on white may disappear on gray or become too heavy on dark UI. Also check responsive layouts. A card shadow that feels balanced on desktop may look oversized on a small mobile card. Keep the final CSS in a reusable variable or component token if the same elevation style appears in several places.

FAQ

What is box-shadow in CSS?

box-shadow adds a shadow around or inside an element using offset, blur, spread, and color values.

Can I create inset shadows?

Yes. Turn on the inset option before copying the CSS.

Does this generate React Native shadows?

It generates CSS. React Native uses different shadow properties, but the preview can still help choose direction and softness.

Related tools

Box shadow with gradient and layered effects

A box shadow uses a single color, but you can simulate a gradient shadow by layering multiple box-shadow declarations on the same element. Combine a larger, softer shadow with a smaller, tighter shadow to create depth that feels like a gradient fade. Set the first shadow to a lighter opacity and the second to a darker tone for a natural fall-off effect.

CSS text-shadow does not support gradient values. For text, adapt the generated x offset, y offset, blur, and color into text-shadow: x y blur color; and verify readability against the actual background. Inline shadow styles work the same way: apply the value directly in the style attribute for quick prototyping.

Box shadow, inner shadow, image shadow, and text shadow

Use the inset option for an inner box shadow on a div, button, card, input, or image container. CSS text-shadow is a different property and does not support an inset keyword or a spread-radius value. For text, adapt the generated x offset, y offset, blur, and color into text-shadow: x y blur color; and verify readability.

This page generates one CSS box-shadow declaration. Background blur, image-background editing, gradients, and border generators are separate effects and are not silently mixed into the output.

CSS bottom shadow for div elements

A CSS bottom shadow places a shadow below an element using box-shadow: 0 4px 12px rgba(0,0,0,0.15);. The first value (0) keeps the shadow centered horizontally, the second (4px) pushes it downward, and the third (12px) controls blur. Adjust the spread and opacity for a softer or sharper effect.

For image containers, combine a bottom shadow with a slight translateY on hover for a lifting effect. Use the generator above to preview different shadow strengths before copying the value into your CSS.

CSS drop shadow effect

A CSS drop shadow creates the illusion of depth by adding a blurred shadow below or around an element. The filter: drop-shadow() property follows the element shape, including transparent areas, unlike box-shadow which follows the rectangular box. This makes drop-shadow ideal for non-rectangular elements like icons, logos, and PNG images with transparency.

To create a CSS drop shadow, use filter: drop-shadow(x y blur color) where x is horizontal offset, y is vertical offset, blur is the spread, and color is the shadow color. For a natural shadow effect, use filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1)). Combine with the Box Shadow Generator above for box-based shadows.