Modals

A modal is a dialog box that overlays the current page. Use modals to display components related to a specific task or secondary information without requiring users to leave the page.

Use modals

You can create modals in the Surfaces area of the Index. When you add a modal, it appears on the canvas, where you can add and configure components to define its content and behavior.

To display a modal to the end user, add a Show modal action to an Action flows and select the modal. You can reuse the same modal across multiple action flows.

Work with modals

Context considerations

As a surface, this element serves as a context container, filtering and displaying context-specific data. Rather than hardcoding values, you'll define one or more context variables—named placeholders for fields like record Ids—to identify which data should be shown. These context variables are assigned each time an action flow calls this surface, allowing you to reuse the same panel, modal, or drawer for multiple scenarios simply by passing in different values each time it's opened.

Set context variables explicitly in each action that opens a surface.

For more information, see Context.

Best Practices

  • Keep in mind that a modal provides limited space and acts as a temporary working area. Use modals for specific tasks that users complete before returning to the workflow on the underlying page.

  • Use modals as row actions within the Table component, using context conditions to display related data.
  • To prevent a modal from closing accidentally when users click outside it, turn on the Restrict closing the modal toggle. When turned on, users can only close the modal by clicking or by leaving the page.

Component properties