Modal

Outside the canon

From 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

#sizes

sm, md, lg and xl panels; each has a header, a scrollable body and a sticky footer.

Confirm dialog

#confirm

ConfirmModal: the consequence spelled out, then Cancel or the action (P3 soft block).

Props

NameTypeDefaultNotes
openboolean—Controlled
onOpenChange(open: boolean) => void—
titleReactNode—
descriptionReactNode—Under the title; a sr-only one is rendered when absent
sizesm | md | lg | xlmdmax-w-md / lg / 2xl / 4xl
footerReactNode—Right-aligned buttons in the sticky footer
fallback_focusRefObject<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