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
| Animation | Description |
|---|---|
fade | Fade in/out |
slideLeft | Slide from left |
slideRight | Slide 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
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
isOpen | boolean | - | Yes | Whether the overlay is open |
onClose | () => void | - | No | Called on backdrop click or Escape |
children | ReactNode | - | Yes | Content |
animation | 'fade' | 'slideLeft' | 'slideRight' | 'fade' | No | Enter and exit motion. Slides become fades with reduced motion |
backgroundOpacity | number | '50' | No | Backdrop opacity from 0 to 100 |
disableBackdropClick | boolean | false | No | Keeps it open on backdrop click |
disableEscapeKey | boolean | false | No | Keeps it open on Escape |
zIndex | number | '1000' | No | Stacking order |
backdropClassName | string | - | No | Extra class for the backdrop |
contentClassName | string | - | No | Extra class for the content |
ariaLabel | string | - | No | Accessible name of the content (role="dialog") |
container | Element | DocumentFragment | 'document.body' | No | Where to render |
Usage
Specification
base
| 상태 | 요소 | 속성 | 값 |
|---|---|---|---|
| enabled | backdrop | backgroundColor | rgba(0, 0, 0, 0.5)토큰 아님 — black at backgroundOpacity (default 50) |