Modal

overlay

Full-featured modal with backdrop blur, scale + fade entrance animation, and focus trap via Radix Dialog portal.

import { Modal } from '@/components/forge'

Preview

Modal

Code Example

Props

PropTypeDefaultRequiredDescription
openboolean-YesControls modal visibility
onOpenChange(open: boolean) => void-NoCallback when modal open state changes
titlestring-NoModal heading
descriptionstring-NoSubtext below the title
childrenReact.ReactNode-NoModal body content
size'sm' | 'md' | 'lg''md'NoMax width of the modal

Variants

smmdlg

Accessibility

  • Uses Radix Dialog for focus trap and Escape key dismissal
  • Title is bound to aria-labelledby on the dialog role element
  • Backdrop click dismisses the modal
  • Focus returns to trigger element on close

Related Components