Shadow / Elevation

Components

Shadow / Elevation

A shadow is the soft, blurry mark an element casts behind itself, showing how far it floats above the surface — a distance called elevation.

elevation 2
elevation2

Definition

A shadow is the soft, blurry mark an element casts behind itself, and it makes something invisible suddenly visible: how far that element is lifted off the screen. We call that lifted distance elevation. When a shadow is small, dark, and hugs the element tightly, the element looks like it is resting flat on the surface. When the shadow grows large, soft, and spreads out wide, the element looks like it has been raised well above everything else. This mirrors how the real world works — the higher an object floats, the bigger and fainter its shadow becomes — so we instantly read which element is on top without anyone having to explain it.

Why does it matter?

A shadow is not just decoration; it is a signal about the z-axis of your screen, telling the user what is in front and what is behind. Elements that sit on top of other content and need to grab attention — like a modal or a popover — get a large shadow so they clearly float above the page. A card resting quietly in the background, by contrast, gets a faint shadow or none at all, so it stays calm and settled. When you space elements out by elevation like this, the user naturally understands which element is active right now and where their focus should go. Shadows also hint at motion, as if something is being pressed down or lifting up: hover over a button and a growing shadow makes it feel like it rises slightly toward you. But restraint is everything with shadows. Drop a heavy shadow on every element and the whole screen turns heavy and cluttered — the hierarchy you were trying to build disappears, leaving only visual noise.

Common mistakes

  • Putting a shadow on everything. When cards, buttons, and input fields are all floating at once, nothing reads as truly raised and the hierarchy collapses. Shadows only carry weight when you save them for the elements you actually want to emphasize.
  • Making shadows too dark and too hard. A near-black shadow with almost no blur looks like a dark border around the element and leaves a cheap, dated impression. Keep it light and softly spread, the way real light behaves, and it reads as natural.
  • Mismatching the elevation and the size of the shadow. Give a background-hugging card a modal-sized shadow and users get confused about why it appears to float so high. Pick a shadow whose size matches the element's real role.

Practical tips

  • Think of shadows as elevation and decide on just two or three levels up front. For example, pair low with cards, medium with dropdowns, and high with modals. Tying depth to roles like this keeps a consistent sense of depth across every screen and makes it obvious at a glance what is raised.
  • For the shadow color, reach for a slightly darkened version of the element's background rather than pure black. Give it low opacity and a generous blur and it looks far softer and more refined. Stacking several faint shadows creates more natural depth than a single heavy one.
  • On light backgrounds where a shadow alone struggles to define an edge, add a very subtle border alongside it to lightly reinforce the element's outline, and the whole thing feels more grounded.

Ask your AI

Shadows on everything, nothing reads as raised

In the CSS/JSX I'm pasting below, find every box-shadow and keep it only on elements that should genuinely float — strip it off the rest. Collapse what's left into just three elevation levels — low, medium, high — and pair them to roles: low for cards, medium for dropdowns/popovers, high for modals. If a background-hugging card has a modal-sized shadow, drop it down to the low level. Give me a table of which element moved to which level and why you removed the shadows you removed.

Shadows look dark, hard, and cheap

The box-shadows in the code below are near-black with almost no blur, so they read like a dark border. Swap the color from pure black to a slightly darkened tone of [the element's background — e.g. a #ffffff card], keep the opacity low (roughly 8–15%), and give it a generous blur so it stays soft. Instead of one heavy shadow, stack two or three faint layers for natural depth. If it sits on a light background where the edge gets lost, add one very subtle border alongside it. Return the new box-shadow values with your reasoning.

Starting an elevation token set for a new project

This product is [nature of the service — e.g. a data-dense SaaS dashboard]. Design an elevation (shadow) token set for it. Use only three levels — low, medium, high — as CSS variables --shadow-low, --shadow-medium, --shadow-high, and spell out the roles: low for cards, medium for dropdowns/popovers, high for modals. Build each level from a slightly darkened background tone rather than pure black, with low opacity and a generous blur, and make the higher levels spread larger and softer. Compose each from several faint layers rather than one heavy shadow, and lay out the per-level values and their roles in a table.

Related concepts