Skip to main content

Drop Shadow

UI Design

What is a Drop Shadow

A drop shadow is a shadow placed behind an element so it looks raised above the surface. In UI design, drop shadows show depth and help users see which elements sit on top, such as cards, menus and dialogs.

How a Drop Shadow works

A shadow is set by a few values:

  • Offset: How far the shadow moves on the X and Y axes
  • Blur: How soft the edge is
  • Spread: How much larger the shadow is than the element
  • Color and opacity: Usually a dark, transparent color

Drop Shadows in CSS

box-shadow draws a shadow around the element's box and follows rounded corners. The drop-shadow() filter follows the actual shape of the content, such as a transparent icon.

When to use Drop Shadows

Use shadows to show elevation: floating buttons, menus, dialogs and dragged items. Keep them soft and consistent, with one light direction. Styles such as neumorphism and claymorphism are built almost entirely from shadows.

Frequently asked questions

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

box-shadow draws a shadow around the element's rectangular box, following its rounded corners. The drop-shadow() filter follows the actual shape of the content, such as the outline of a transparent icon.

What does a drop shadow tell users?

It shows that an element sits above the surface behind it. Larger, softer shadows suggest the element is higher, for example a dialog above a page.

Do drop shadows work in dark mode?

They are much harder to see on dark backgrounds. Dark themes usually show depth with lighter surface colors for higher elements instead.