Sheet
The Sheet component displays essential information for customers at the bottom of the screen, appearing above other elements. Use it sparingly to avoid distracting customers during checkout. This component requires access to Customer Privacy API to be rendered.
The library automatically applies the WAI-ARIA Dialog pattern to both the activator and the sheet content.
Anchor to propertiesProperties
- Anchor to accessibilityLabelaccessibilityLabelstring
A label that describes the purpose of the modal. When set, it will be announced to users using assistive technologies and will provide them with more context.
This overrides the
heading
prop for screen readers.- Anchor to defaultOpendefaultOpenbooleanDefault: false
Indicates whether the Sheet should be open by default. This property is necessary in some cases, but its usage is generally discouraged due to potential negative impacts on user experience.
Developers should:
- Only set this property to true when there are vitally important behaviors of the application that depend on the user interacting with the sheet.
- Make every effort to conditionally hide the sheet based on the state of checkout. An explicit example is custom privacy consent, where the sheet should only be displayed when consent is necessary and has not yet been explicitly given by the user.
This property is useful for when the Sheet needs to be rendered on the page load and not triggered by a user action. The property should only take effect when the
Sheet
is rendered for the first time. To toggle the Sheet after it has been rendered, use themethod instead.
- Anchor to headingheadingstring
A title that describes the content of the sheet.
- string
A unique identifier for the element.
Anchor to eventsEvents
- Anchor to afterhideafterhide((event: CallbackEventListener<typeof tagName>) => void) | null
Callback fired when the overlay is hidden after any animations to hide the overlay have finished.
- Anchor to aftershowaftershow((event: CallbackEventListener<typeof tagName>) => void) | null
Callback fired when the overlay is shown after any animations to show the overlay have finished.
- Anchor to hidehide((event: CallbackEventListener<typeof tagName>) => void) | null
Callback fired after the overlay is hidden.
- Anchor to showshow((event: CallbackEventListener<typeof tagName>) => void) | null
Callback fired after the overlay is shown.
CallbackEventListener
(EventListener & {
(event: CallbackEvent<TTagName, TEvent>): void;
}) | null
CallbackEvent
TEvent & {
currentTarget: HTMLElementTagNameMap[TTagName];
}
Anchor to slotsSlots
- Anchor to primary-actionprimary-actionHTMLElement
The primary action to perform, provided as a button type element.
- Anchor to secondary-actionssecondary-actionsHTMLElement
The secondary actions to perform, provided as a button type element.
Anchor to methodsMethods
- Anchor to hideOverlayhideOverlay() => voidrequired
Method to hide an overlay.
Code
Examples
Code
Default
<!-- This component requires access to Customer Privacy API to be rendered. --> <s-button commandFor="consent-sheet">Open Sheet</s-button> <s-sheet id="consent-sheet" heading="Sheet" accessibilityLabel="A sheet with text content"> <s-text>Sheet Content</s-text> </s-sheet>
Preview

Anchor to shopify-controlled-surfacesShopify-controlled surfaces
To prevent disruptions during checkout, we maintain strict design control over key areas of the Sheet component. These Shopify-controlled elements include:
Locations of elements
The Sheet elements (header, content, action buttons, and dismiss button) are strategically positioned and sized to present vital information upfront.


Padding and spacing

Maximum height
To balance customer attention and task completion, a maximum height is set for the Sheet component.


When content pushes the sheet to exceed this limit, the following UI behaviors are triggered:
Heading and content are scrollable

Expand pill appears to allow customers to view the entire content

Actions slot and dismiss button remain fixed

Anchor to privacy-consent-requirementsPrivacy consent requirements
Content
For the best customer experience, ensure content is brief and to the point.

Various strategies can be employed to avoid content scrolling.
Use short content

Use small text size

Remove the header

Actions slot
The actions slots allows customers to make decisions and is split into primary and secondary sections.

Primary section
Contains primary actions for customer decisions on the sheet's prompt. Up to two buttons are allowed. Keep the button's content brief so that it doesn't wrap to more than one line.

Secondary section
Contains action that is unrelated to the sheet's prompt. Only one button is allowed. A modal can be activated when engaging with the secondary action. Keep the button's content brief so that it doesn't wrap to more than one line.

Consent, denial of consent, and sheet dismissal
Consent
When a customer expresses consent by pressing the acceptance button, cookies will load and the sheet should not re-appear on refresh.
Denial of consent
When a customer expresses denial of consent by pressing the rejection button, cookies will not load and the sheet will not re-appear on refresh.
Sheet dismissal
When a customer neither grants nor denies consent by pressing the dismiss button, cookies will not load and the sheet will re-appear on refresh.
