Skip to content
Browse documentation
whisk/ui

Shadows

Use the shared shadow scale to express elevation without copying raw box-shadow values.

Shadow scale

Shadow tokens express elevation without exposing raw box-shadow values. The light theme uses a quiet black shadow scale. The dark theme strengthens the ambient shadow and adds a restrained highlight so elevated surfaces remain legible.

Dark theme

none
xs
sm
md
lg
xl
2xl

Light theme

none
xs
sm
md
lg
xl
2xl

Light and dark elevation

Keep the same shadow prop in both modes. The active theme supplies the appropriate elevation treatment for the surface.

Menu surface

import { Box, Text } from "@smoothie-framework/whisk-react";

<Box background="surface2" rounded="lg" shadow="md" padding={4}>
  <Text>Menu surface</Text>
</Box>

Dialog surface

import { Box, Text } from "@smoothie-framework/whisk-react";

<Box background="surface2" rounded="lg" shadow="xl" padding={4}>
  <Text>Dialog surface</Text>
</Box>

Use elevation

Prefer surface and border roles for ordinary hierarchy. Add a shadow when a panel, menu, or dialog needs to read as physically above its surroundings.

Raised card

import { Box, Text } from "@smoothie-framework/whisk-react";

<Box background="surface2" rounded="lg" shadow="sm" padding={4}>
  <Text>Raised card</Text>
</Box>
  • Use xs or sm for modestly raised cards and compact surfaces.
  • Use md for menus, selects, and popovers; use lg for drawers or side panels.
  • Use xl for dialogs. Reserve 2xl for exceptional, highest-elevation surfaces.
  • Do not use shadow alone to communicate selection, an error, or keyboard focus.

Shadow props

PropTypeDefaultDescription
shadowShadowTokennoneApply a named elevation from the shared shadow scale.