Modal
Accessible dialog with focus management, Escape/scrim dismissal, built-in form submission, and `busy` lock.
Modal Sizes (narrow / default / wide)
Powered by useModalBehavior: Escape close, backdrop scrim click, body scroll lock, and focus restoration.
Form Modal with Async busy Lock
API Reference (Props)
| Name | Type | Default | Description |
|---|---|---|---|
| open* | boolean | — | Controls whether the modal is mounted and visible. |
| onClose* | () => void | — | Callback invoked when closing the modal. |
| title / subtitle* | ReactNode | — | Dialog title and optional subtitle. |
| size | 'narrow' | 'default' | 'wide' | 'default' | Width preset for the dialog. |
| onSubmit / busy | () => void / boolean | — | Wraps body/footer in a `<form>` and prevents dismissal while `busy`. |
| loading | boolean | false | Renders `ModalSkeleton` inside the modal body while initial data loads. |