Skip to content

Elevation

Elevation utilities add box-shadow effects to create a sense of depth and visual hierarchy. They are commonly used on cards, modals, and popovers to lift elements above the surrounding content.

TokenValueUse case
--tng-elevation-sm0 4px 10px 0 rgb(108 112 115 / 10%)Subtle lift — cards, list items
--tng-elevation-md0 15px 80px … (multi-layer)Mid-level — dropdowns, popovers
--tng-elevation-lg0 15px 80px … (multi-layer)High emphasis — modals, dialogs

All medium and large shadows use multi-layer box-shadow values to create a more natural-looking depth effect. Each layer targets a different spread and opacity, mimicking how real-world shadows behave at varying distances from a light source.

ClassSets
.elevation-nonebox-shadow: none
.elevation-smbox-shadow: var(--tng-elevation-sm)
.elevation-mdbox-shadow: var(--tng-elevation-md)
.elevation-lgbox-shadow: var(--tng-elevation-lg)
.elevation-sm
.elevation-md
.elevation-lg
ElevationTypical use
noneReset elevation on a previously elevated element
smCards, tiles, list items — subtle lift to separate from surface
mdDropdowns, popovers, floating action buttons
lgModals, dialogs, side panels — highest emphasis

Several components apply elevation automatically so you don’t need to set it yourself:

ComponentDefault elevation
.tng-modalvar(--tng-elevation-lg)
.tng-popovervar(--tng-elevation-md)
.tng-dropdownvar(--tng-elevation-md)
  • Don’t stack shadows — avoid combining elevation utilities with custom box-shadow declarations.
  • Match elevation to hierarchy — more important or more “forward” UI elements should use higher elevation. Background content should use less.
  • Pair with radius — elevated elements almost always look better with rounded corners. Combine with border radius utilities.