Using Confirm

Confirm is a global confirm dialog system you trigger from anywhere using the useConfirm() hook. It queues requests and renders a modal with OK/Cancel, wired to RPG Maker inputs (OK/Cancel/Left/Right).

Files

  • menus/src/components/Confirm.tsx

  • Provider is mounted in menus/src/index.tsx

Confirm dialog – default

Provider setup

Ensure your root is wrapped with the provider (already done in this repo):

Show a confirm dialog

Options (ConfirmOptions)

  • title?: string

  • message?: React.ReactNode

  • confirmText?: string, cancelText?: string

  • confirmVariant?: 'primary'|'secondary', cancelVariant?: 'primary'|'secondary'

  • disableBackdropClose?: boolean

  • children?: React.ReactNode — extra JSX inside the dialog

Input behavior

Handled via InputContext internally:

  • CANCEL closes as Cancel

  • OK confirms

  • LEFT/RIGHT toggles the selection

See also

Last updated