Skip to content

Surface

The Surface component is an engineering-only primitive that applies consistent elevation (box-shadow and background tokens) to containers for visual depth and hierarchy. It is not intended for direct design specification and exists as a quality-of-life tool for engineers to ensure token usage remains uniform.

  • Wrap containers needing standardized depth (e.g., cards, modals, panels) to automatically apply the correct elevation background and shadow tokens.
  • Maintain consistency across implementations without manual token referencing.
  • Compose with other components where layered hierarchy is required.
  • Card or panel wrapper: Apply raised elevation for content lifted above page background.
  • Modal or popover: Use overlay elevation for floating, blocking layers.
  • Inset elements: Sunken for recessed areas like content wells.
  • For user-facing design decisions; reference elevation guidelines.
  • When no depth is needed (prefer plain containers with background tokens).
  • For interactive controls; elevation is visual only.
VariantDescriptionRecommended Context
SunkenInset appearanceRecessed areas, wells
DefaultFlat, no elevationBase page content, primary surfaces
RaisedModerate liftCards, floating elements
OverlayProminent floating layerModals, drawers, popovers, contextual help
ElementDescription
ContainerWrapper element applying elevation background and shadow tokens.
ChildrenContent placed within the surface (inherits elevation styling).
  • Surface adds no interactivity; accessibility inherits from child content.
  • Ensure applied shadows and backgrounds maintain sufficient contrast (≥4.5:1) for text and controls.
  • Test in high-contrast and forced-colors modes; shadows may be overridden by system settings.

Support standard keyboard navigation Not applicable (Surface is non-interactive; keyboard behavior inherits from children).