Modal
Overview
A dialog that pops up over the page when its "open" state is switched on — typically by a button — and closes with the X, the Escape key or a click outside. Use it for confirmations and short forms that should not leave the page.
A dialog that opens when its state 'open' is set to true (e.g. by a button).
When to use
- "Are you sure you want to cancel this booking?" confirmation with Yes/No buttons.
- Quick "Add note" form on a customer page.
- A preview of terms and conditions before signing up.
- Edit a single field without navigating away.
When not to use
- The dialog content is a full page you reuse from many places (a complete record form): create a page with page type Modal and open it with the Open modal action — it receives parameters and has its own permissions.
- The content is long: use a Drawer or a separate page.
Quick start
- Drag Modal onto the page. In the editor it shows inline as a dashed box so you can edit it; in preview it is hidden until opened.
- Set the Title and Size in the Content tab, then drop the dialog content inside.
- Add a Button elsewhere on the page: Actions tab → On Click → Set state → State: Component state, Component: this modal, Key: open, Value: true.
- Inside the modal, add a "Close" button with Set state → open → false (or let visitors use the X).
- Test in Preview.
Layout rules
- Can contain any component.
- Can be placed in any container (page, section, card, row, column, grid…).
Properties
Text in the dialog's header bar, next to the close button. Can be bound.
Default: Dialog
Width of the dialog.
Options: sm — compact confirmation, md — standard, lg — wide, for tables or multi-column forms
Default: md
Data binding
Properties that can use dynamic data: Title.
Events
- On open
- Runs when the modal becomes visible (open state turns true). Useful to Refresh data shown inside.
- On close
- Runs when the modal is dismissed by any means (X, Escape, backdrop click or a Set state action). Useful to reset a form or refresh the page's table.
Actions
Open the Actions tab in the inspector, pick an event and add actions such as Go to page, Create record or Show message. Actions run in order; data-changing actions run on the server with the signed-in user's permissions.
Other components can read this component's open from the Data Picker → Component state.
Responsive behavior
The dialog is centred and shrinks to the screen width on phones; long content scrolls inside it.
Permissions
Permissions on the modal apply to its content. The button that opens it is a separate component — restrict both when only some roles should see the feature.
Accessibility
- Rendered as a dialog with the title as its accessible name; keyboard users can close it with Escape.
Examples
Confirmation dialog
Modal (Title: Cancel booking?, Size: sm) Paragraph "This cannot be undone." Row: Button "Keep" (Set state → open → false), Button "Cancel booking" (danger; Delete record → Bookings, then Set state → open → false) Trigger: Button "Cancel" → Set state → Component state → Modal → open → true
Common patterns
- Close the modal as the last action of a successful save so the visitor returns to the page.
- Show which record is being edited with a Heading bound to {{component.<tableId>.selectedRecord.name}} after a table row was clicked.
Limitations
- Nesting: can contain any component. Can be placed in any container (page, section, card, tab, accordion item, step, modal, drawer…). The modal lives on one page; it cannot be opened from another page.
- The dialog's open state resets to closed when the page reloads.
- Modal pages (page type Modal) are a different feature: they are whole pages opened with the Open modal action and closed with Close modal.
Troubleshooting
Why: The action targets app or page state instead of the modal's component state, or the key is not exactly "open".
Fix: In the Set state action choose State: Component state, select the modal and type open as the key with value true.
Why: The editor shows overlays inline so you can edit them.
Fix: Use Preview to see it closed.