Skip to main content

Modal API

The Modal API lets you display an overlay that prevents interaction with the rest of the app until dismissed. Use modals for confirmations, forms, or important information that requires merchant acknowledgement before proceeding.

  • Confirmation dialogs: Display confirmation prompts before destructive actions like deleting resources.
  • Detail views: Show detailed information in an overlay without navigating away from the current page.
  • Form workflows: Present focused forms for data entry in a distraction-free overlay.
  • Content preview: Preview content like templates or messages before publishing.

The modal function provides methods to control modal visibility by a component's ID. These methods work with the s-modal component and are alternatives to calling instance methods directly on the element.

(id: string) => Promise<void>

Hides the modal element. An alternative to the hideOverlay instance method on the s-modal component.

(id: string) => Promise<void>

Shows the modal element. An alternative to the showOverlay instance method on the s-modal component.

Anchor to toggle
toggle
(id: string) => Promise<void>

Toggles the modal element visibility. An alternative to the toggleOverlay instance method on the s-modal component.


Was this page helpful?