Using BaseModal

BaseModal gives you a modal window with a dim backdrop and CANCEL-key close, wired to RPG Maker events via the bridge.

All modals in the demo app use based modal.

BaseModal – with custom content

File: menus/src/components/BaseModal.tsx

Props

  • show: boolean — visible state

  • onHide(force?: boolean) — called to close (backdrop click or CANCEL)

  • className?: string — extra classes for sizing/styling

  • children?: React.ReactNode

Behavior

  • Subscribes to CANCEL_EVENT and calls onHide(true)

  • Renders a backdrop and portals modal content

Example: simple dialog

Tips

  • Combine with InputContext if you need in-modal navigation.

  • Prefer closing on CANCEL to match RPG conventions.

See also

Last updated