Skip to main content

Press button

Allows users to toggle between active/inactive states. Use to represent a persistent on/off or selected/unselected status.

Support
Targets (29)

Supported targets

  • purchase.checkout.actions.render-before
  • purchase.checkout.block.render
  • purchase.checkout.cart-line-item.render-after
  • purchase.checkout.cart-line-list.render-after
  • purchase.checkout.contact.render-after
  • purchase.checkout.delivery-address.render-after
  • purchase.checkout.delivery-address.render-before
  • purchase.checkout.footer.render-after
  • purchase.checkout.header.render-after
  • purchase.checkout.payment-method-list.render-after
  • purchase.checkout.payment-method-list.render-before
  • purchase.checkout.pickup-location-list.render-after
  • purchase.checkout.pickup-location-list.render-before
  • purchase.checkout.pickup-location-option-item.render-after
  • purchase.checkout.pickup-point-list.render-after
  • purchase.checkout.pickup-point-list.render-before
  • purchase.checkout.reductions.render-after
  • purchase.checkout.reductions.render-before
  • purchase.checkout.shipping-option-item.details.render
  • purchase.checkout.shipping-option-item.render-after
  • purchase.checkout.shipping-option-list.render-after
  • purchase.checkout.shipping-option-list.render-before
  • purchase.thank-you.announcement.render
  • purchase.thank-you.block.render
  • purchase.thank-you.cart-line-item.render-after
  • purchase.thank-you.cart-line-list.render-after
  • purchase.thank-you.customer-information.render-after
  • purchase.thank-you.footer.render-after
  • purchase.thank-you.header.render-after

Anchor to accessibilityLabel
accessibilityLabel
string

A label that describes the purpose or contents of the Button. It will be read to users using assistive technologies such as screen readers.

Use this when using only an icon or the Button text is not enough context for users using assistive technologies.

Anchor to defaultPressed
defaultPressed
boolean
Default: false

Whether the button is pressed by default.

Anchor to disabled
disabled
boolean
Default: false

Disables the Button meaning it cannot be clicked or receive focus.

string

A unique identifier for the element.

Anchor to inlineSize
inlineSize
'auto' | 'fill' | 'fit-content'
Default: 'auto'

The displayed inline width of the Button.

  • auto: the size of the button depends on the surface and context.
  • fill: the button will takes up 100% of the available inline size.
  • fit-content: the button will take up the minimum inline-size required to fit its content.
string

Indicate the text language. Useful when the text is in a different language than the rest of the page. It will allow assistive technologies such as screen readers to invoke the correct pronunciation. Reference of values ("subtag" label)

Anchor to loading
loading
boolean
Default: false

Replaces content with a loading indicator while a background action is being performed.

This also disables the Button.

Anchor to pressed
pressed
boolean
Default: false

Whether the button is pressed.

Learn more about registering events.

<typeof tagName>

Callback when the button has lost focus.

Anchor to click
click
<typeof tagName>

Callback when the button is activated.

Anchor to focus
focus
<typeof tagName>

Callback when the button has received focus.

Examples
<s-press-button>Add gift wrapping</s-press-button>

Preview

Was this page helpful?