Skip to main content

Modal

Use s-modal to display content in an overlay. Modals are used to display important information that requires the merchant's attention.

string

A title that describes the content of the Modal.

string

A unique identifier for the element.

Was this section helpful?

HTMLElement
HTMLElement
Was this section helpful?

(event: <"s-divider">) => void
(event: <"s-divider">) => void
Was this section helpful?

Code

<s-button command="--show" commandFor="modal">Open modal</s-button>
<s-modal id="modal" heading="Header">
<s-stack alignItems="center" justifyContent="center" gap="base">
<s-text color="subdued">Subheader</s-text>
</s-stack>
<s-button slot="primary-action" onClick={handlePrimaryAction}>
Label
</s-button>
</s-modal>

Preview