Center Morph Modal

A composable modal whose full-size surface unfolds from a fully collapsed center, then folds back with an inset close control and stays collapsed until removal. Keeps focus stable across updates and the page scroll-locked until the exit completes.

Preview

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn@latest add @beui/center-morph-modal

API Reference

CenterMorphModal

open?
boolean

Controlled open state.

—
defaultOpen?
boolean

Initial state when used uncontrolled.

false
onOpenChange?
((open: boolean) => void)
—

CenterMorphModalContent

ariaLabel
string

Accessible name announced by screen readers.

—
ariaDescribedBy?
string

Optional id of descriptive content inside the modal.

—
dismissible?
boolean

Close on Escape or backdrop press. Default true.

true
showCloseButton?
boolean

Render the close control inside the panel's top-right corner. Default true.

true
closeButtonLabel?
string
Close modal
className?
string
—
backdropClassName?
string
—

Updated