Drop shadow
Also called box shadow or elevation
A shadow cast behind an element to make it look raised off the page, with larger, softer shadows signaling higher elevation.
import { Tooltip } from '@base-ui/react/tooltip';
// Elevation: higher things get larger, softer, fainter shadows. Tailwind's
// shadow-xs, shadow-lg, and shadow-2xl work as a card, menu, dialog scale.
export function DocumentCard() {
return (
// Two layers: a tight contact shadow plus a wide, faint ambient one.
<article className='w-72 rounded-xl border bg-background p-5 shadow-[0_1px_2px_rgb(0_0_0/0.06),0_4px_12px_rgb(0_0_0/0.08)]'>
<h3 className='font-semibold'>Q3 roadmap</h3>
<p className='mt-1 text-sm text-muted-foreground'>Edited 2 hours ago</p>
<Tooltip.Root>
<Tooltip.Trigger className='mt-4 rounded-lg border px-3 py-1.5 text-sm hover:bg-muted'>
Share
</Tooltip.Trigger>
<Tooltip.Portal>
<Tooltip.Positioner sideOffset={10}>
{/* drop-shadow follows the arrow's shape; box-shadow would skip it. */}
<Tooltip.Popup className='relative rounded-md bg-background px-2.5 py-1.5 text-xs drop-shadow-[0_4px_8px_rgb(0_0_0/0.18)]'>
<Tooltip.Arrow className='data-[side=bottom]:-top-1.5 data-[side=top]:-bottom-1.5 data-[side=top]:rotate-180'>
<svg
width='12'
height='6'
viewBox='0 0 12 6'
className='block fill-background'
>
<path d='M0 6 6 0l6 6z' />
</svg>
</Tooltip.Arrow>
Anyone with the link can view
</Tooltip.Popup>
</Tooltip.Positioner>
</Tooltip.Portal>
</Tooltip.Root>
</article>
);
}Define a 4-step elevation scale as CSS variables with layered box-shadows (1: 0 1px 2px rgba(0, 0, 0, 0.06); 2: 0 2px 4px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.08); 3: 0 8px 24px -4px rgba(0, 0, 0, 0.14); 4: 0 24px 48px -12px rgba(0, 0, 0, 0.25)). Use level 1 for cards, 3 for dropdowns, and 4 for dialogs, and use filter: drop-shadow() on tooltips so the arrow gets a shadow too.
Paste into Layerwise or any AI coding tool.
What is Drop shadow?
A drop shadow is a darker, blurred copy of an element’s outline, usually offset downward as if light came from above. Small, tight shadows make a card look slightly raised; larger, softer, fainter shadows make a menu or dialog look like it floats. Design systems turn this into a short scale of elevation levels.
CSS offers two tools. box-shadow follows the element’s box and corner radius, supports spread and inset shadows, and stacks several layers for realistic depth. filter: drop-shadow() follows the visible shape instead, including transparent PNGs, SVG icons, and tooltip arrows, but has no spread or inset.
Layer two or three shadows, a tight one for contact plus a wide, faint one for ambient light, for depth that looks natural. Shadows barely show in dark mode, so lighter surfaces and subtle borders do more of the work there.
Often confused with
- Glow effect
- A glow is centered, colored light that draws attention. A drop shadow is dark and offset, and it shows how high an element sits.
Related terms
All termsGlow effect
A soft halo of colored light around a button, card, or text, made with colored shadows or a blurred layer behind the element.
Neumorphism
A soft UI style where buttons and cards look pushed out of, or pressed into, a surface of the same color, using light and dark shadows.
Card
A bordered, rounded container that groups one item’s image, title, details, and actions so it can sit in a list or grid with others.
Z-index
A CSS property that decides which element appears on top when elements overlap, with higher numbers sitting closer to the viewer.
Build it with Layerwise
Describe your app, watch it run in a live preview, and publish it with a database, storage, and sign-in built in.