Center Morph Modal

A dialog that opens by growing out of its own middle: the full panel starts clipped to a small rounded point at the center and expands to every edge, then shrinks back on close. Traps Tab, closes on Escape or backdrop, and hands focus back to its trigger.

Preview

Center Morph Modal preview width

Install

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

$ bunx --bun shadcn add @karaui/center-morph-modal
@karaui not found? Add it to components.json
{
  "registries": {
    "@karaui": "https://karaui.kamisama-v0.my.id/r/{name}.json"
  }
}

@karaui is in shadcn's public registry directory, so the latest CLI needs no setup. On an older CLI, merge this into the existing file once and every @karaui/… install resolves.

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