Modal
Accessible modal dialog for React. Closes with Escape or a click outside, locks scroll and restores focus.
How to use it
Run npx @blossomui/react add modal, or copy src/components/UI/Modal/Modal.tsx into your React project and import it.
import { Modal } from './components/ui/Modal'Props
ModalProps
| Prop | Type | Description |
|---|---|---|
| closeLabel | string | Accessible name of the close button. |
| open (required) | boolean | |
| onClose (required) | () => void | |
| title (required) | string | |
| children (required) | ReactNode | |
| footer | ReactNode | Buttons shown at the bottom, for example Cancel and Accept. |
| size | 'sm' | 'md' | 'lg' | |
| closeOnBackdrop | boolean | Close when the user clicks outside the modal. |