Skip to main content

Sheet

Requires configuration of the Customer Privacy capability to be rendered.

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.

Support
Targets (24)

Supported targets

  • customer-account.footer.render-after
  • customer-account.order-index.announcement.render
  • customer-account.order-index.block.render
  • customer-account.order-status.announcement.render
  • customer-account.order-status.block.render
  • customer-account.order-status.cart-line-item.render-after
  • customer-account.order-status.cart-line-list.render-after
  • customer-account.order-status.customer-information.render-after
  • customer-account.order-status.fulfillment-details.render-after
  • customer-account.order-status.payment-details.render-after
  • customer-account.order-status.return-details.render-after
  • customer-account.order-status.unfulfilled-items.render-after
  • customer-account.order.action.menu-item.render
  • customer-account.order.action.render
  • customer-account.order.page.render
  • customer-account.page.render
  • customer-account.profile.addresses.render-after
  • customer-account.profile.announcement.render
  • customer-account.profile.block.render
  • customer-account.profile.company-details.render-after
  • customer-account.profile.company-location-addresses.render-after
  • customer-account.profile.company-location-payment.render-after
  • customer-account.profile.company-location-staff.render-after
  • customer-account.profile.payment.render-after

Anchor to accessibilityLabel
accessibilityLabel
string

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 defaultOpen
defaultOpen
boolean
Default: 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 the ui.showOverlay() method instead.

Anchor to heading
heading
string

A title that describes the content of the sheet.

string

A unique identifier for the element.

Learn more about registering events.

Anchor to afterhide
afterhide
<typeof tagName>

Callback fired when the overlay is hidden after any animations to hide the overlay have finished.

Anchor to aftershow
aftershow
<typeof tagName>

Callback fired when the overlay is shown after any animations to show the overlay have finished.

<typeof tagName>

Callback fired after the overlay is hidden.

<typeof tagName>

Callback fired after the overlay is shown.

Learn more about component slots.

Anchor to primary-action
primary-action
HTMLElement

The primary action to perform, provided as a button type element.

Anchor to secondary-actions
secondary-actions
HTMLElement

The secondary actions to perform, provided as a button type element.

Learn more about component methods.

Anchor to hideOverlay
hideOverlay
() => void
required

Method to hide an overlay.

Examples
<!-- 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

Was this page helpful?