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.
Anchor to Use casesUse cases
- 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.
Anchor to MethodsMethods
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.
- Anchor to hidehidehide(id: string) => Promise<void>(id: string) => Promise<void>
Hides the modal element. An alternative to the
instance method on thes-modalcomponent.- Anchor to showshowshow(id: string) => Promise<void>(id: string) => Promise<void>
Shows the modal element. An alternative to the
instance method on thes-modalcomponent.- Anchor to toggletoggletoggle(id: string) => Promise<void>(id: string) => Promise<void>
Toggles the modal element visibility. An alternative to the
instance method on thes-modalcomponent.
Was this page helpful?