Skip to main content

Modal

Displays content in an overlay that requires merchant attention. Use to present critical information, confirmations, or focused tasks without losing page context.

string

A title that describes the content of the Modal.

string

A unique identifier for the element.

Was this section helpful?

HTMLElement

The primary action button displayed in the modal.

The tone of the button is used to define the tone of the modal.

If omitted, the modal will default to an 'info' tone, and show an 'OK' button, translated according to the user's locale.

HTMLElement

The secondary action buttons displayed in the modal.

Was this section helpful?

(event: <"s-modal">) => void

Callback when the modal is hidden.

(event: <"s-modal">) => void

Callback when the modal is shown.

Was this section helpful?

Code

<s-button command="--show" commandFor="modal">
Open modal
</s-button>
<s-modal id="modal" heading="Changes could not be saved">
Please check your internet connection and try again.
<s-button slot="primary-action">OK</s-button>
</s-modal>

Preview