Components

Overlay

Overlay component for modals, dialogs, and side panels

Overview

Overlay is a component that displays a semi-transparent background over content. Used for modals, confirmation dialogs, side panels, and more.

Features

  • Close on backdrop click (can be disabled)
  • Custom opacity
  • Animation support (fade, slide-left, slide-right)
  • Internal scroll support
  • Focus trapping

Animation Types

AnimationDescription
fadeFade in/out
slideLeftSlide from left
slideRightSlide from right

Timing comes from the motion tokens: the panel slides in over slow and out over moderate, the backdrop fades in over moderate and out over base. The content stays on the page until its closing animation ends. With reduced motion, slides become fades.

Props

PropTypeDefaultRequiredDescription
isOpenboolean-YesWhether the overlay is open
onClose() => void-NoCalled on backdrop click or Escape
childrenReactNode-YesContent
animation'fade' | 'slideLeft' | 'slideRight''fade'NoEnter and exit motion. Slides become fades with reduced motion
backgroundOpacitynumber'50'NoBackdrop opacity from 0 to 100
disableBackdropClickbooleanfalseNoKeeps it open on backdrop click
disableEscapeKeybooleanfalseNoKeeps it open on Escape
zIndexnumber'1000'NoStacking order
backdropClassNamestring-NoExtra class for the backdrop
contentClassNamestring-NoExtra class for the content
ariaLabelstring-NoAccessible name of the content (role="dialog")
containerElement | DocumentFragment'document.body'NoWhere to render

Usage

Specification

base

상태요소속성값
enabledbackdropbackgroundColorrgba(0, 0, 0, 0.5)토큰 아님 — black at backgroundOpacity (default 50)