Modal
Outside the canonFrom the pattern backlog (workshop Modals and Dialogs), built because the Invoicing pages need Refund, Unapply and Remove confirmations. Header, scrollable body, sticky footer, four sizes; ConfirmModal is the P3 soft block. Built on Radix Dialog; the app has the modal and turbo_frame_modal controllers.
App: modal / turbo_frame_modal controllers (outside the canon vocabulary)
Sizes
#sizessm, md, lg and xl panels; each has a header, a scrollable body and a sticky footer.
Confirm dialog
#confirmConfirmModal: the consequence spelled out, then Cancel or the action (P3 soft block).
Props
| Name | Type | Default | Notes |
|---|---|---|---|
| open | boolean | — | Controlled |
| onOpenChange | (open: boolean) => void | — | |
| title | ReactNode | — | |
| description | ReactNode | — | Under the title; a sr-only one is rendered when absent |
| size | sm | md | lg | xl | md | max-w-md / lg / 2xl / 4xl |
| footer | ReactNode | — | Right-aligned buttons in the sticky footer |
| fallback_focus | RefObject<HTMLElement> | — | Where focus goes on close if the dialog's action removed its trigger (Convenience Fee's picker); otherwise back to the trigger |
| ConfirmModal | { title, body, confirm_label, cancel_label, onConfirm } | — | Cancel + primary confirm, size sm |