Button
Triggers actions or events, such as submitting forms, opening dialogs, or navigating to other pages. Use Button to let users perform specific tasks or initiate interactions throughout the interface. Buttons can also function as links, guiding users to internal or external destinations.
Anchor to propertiesProperties
- Anchor to accessibilityLabelaccessibilityLabelstring
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 commandcommand'--auto' | '--show' | '--hide' | '--toggle' | '--copy'Default: '--auto'
Sets the action the
should take when this clickable is activated.
See the documentation of particular components for the actions they support.
--auto
: a default action for the target component.--show
: shows the target component.--hide
: hides the target component.--toggle
: toggles the target component.--copy
: copies the target ClipboardItem.
- Anchor to commandForcommandForstring
ID of a component that should respond to activations (e.g. clicks) on this component.
See
command
for how to control the behavior of the target.- Anchor to disableddisabledbooleanDefault: false
Disables the button, meaning it cannot be clicked or receive focus.
- Anchor to hrefhrefstring
The URL to link to.
- If set, it will navigate to the location specified by
href
after executing theclick
event. - If a
is set, the
command
will be executed instead of the navigation.
- If set, it will navigate to the location specified by
- string
A unique identifier for the element.
- Anchor to inlineSizeinlineSize'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.
- Anchor to loadingloadingbooleanDefault: false
Replaces content with a loading indicator while a background action is being performed.
This also disables the button.
- Anchor to targettarget'auto' | '_blank'
Specifies where to display the linked URL.
- Anchor to tonetone'auto' | 'neutral' | 'critical'
Sets the tone of the Button, based on the intention of the information being conveyed.
- Anchor to typetype'submit' | 'button'
The behavior of the button.
submit
: Used to indicate the component acts as a submit button, meaning it submits the closest form.button
: Used to indicate the component acts as a button, meaning it has no default action.reset
: Used to indicate the component acts as a reset button, meaning it resets the closest form (returning fields to their default values).
This property is ignored if the component supports
href
or/
command
and one of them is set.- Anchor to variantvariant'auto' | 'primary' | 'secondary'
Changes the visual appearance of the Button.
ButtonElementProps
- accessibilityLabel
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.
string
- command
Sets the action the `commandFor` should take when this clickable is activated. See the documentation of particular components for the actions they support. - `--auto`: a default action for the target component. - `--show`: shows the target component. - `--hide`: hides the target component. - `--toggle`: toggles the target component. - `--copy`: copies the target ClipboardItem.
'--auto' | '--show' | '--hide' | '--toggle' | '--copy'
- commandFor
ID of a component that should respond to activations (e.g. clicks) on this component. See `command` for how to control the behavior of the target.
string
- disabled
Disables the button, meaning it cannot be clicked or receive focus.
boolean
- href
The URL to link to. - If set, it will navigate to the location specified by `href` after executing the `click` event. - If a `commandFor` is set, the `command` will be executed instead of the navigation.
string
- id
A unique identifier for the element.
string
- inlineSize
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.
'auto' | 'fill' | 'fit-content'
- loading
Replaces content with a loading indicator while a background action is being performed. This also disables the button.
boolean
- target
Specifies where to display the linked URL.
'auto' | '_blank'
- tone
Sets the tone of the Button, based on the intention of the information being conveyed.
'auto' | 'neutral' | 'critical'
- type
The behavior of the button. - `submit`: Used to indicate the component acts as a submit button, meaning it submits the closest form. - `button`: Used to indicate the component acts as a button, meaning it has no default action. - `reset`: Used to indicate the component acts as a reset button, meaning it resets the closest form (returning fields to their default values). This property is ignored if the component supports `href` or `commandFor`/`command` and one of them is set.
'submit' | 'button'
- variant
Changes the visual appearance of the Button.
'auto' | 'primary' | 'secondary'
export interface ButtonElementProps extends Pick<ButtonProps$1, 'accessibilityLabel' | 'command' | 'commandFor' | 'disabled' | 'href' | 'id' | 'inlineSize' | 'loading' | 'target' | 'tone' | 'type' | 'variant'> {
target?: Extract<ButtonProps$1['target'], 'auto' | '_blank'>;
tone?: Extract<ButtonProps$1['tone'], 'auto' | 'neutral' | 'critical'>;
type?: Extract<ButtonProps$1['type'], 'submit' | 'button'>;
variant?: Extract<ButtonProps$1['variant'], 'auto' | 'primary' | 'secondary'>;
}
Anchor to eventsEvents
- Anchor to clickclick((event: CallbackEventListener<typeof tagName>) => void) | null
Callback when the button is activated. This will be called before the action indicated by
type
.
ButtonElementEvents
- click
Callback when the button is activated. This will be called before the action indicated by `type`.
((event: CallbackEventListener<typeof tagName>) => void) | null
export interface ButtonElementEvents {
/**
* Callback when the button is activated.
* This will be called before the action indicated by `type`.
*/
click?: ((event: CallbackEventListener<typeof tagName>) => void) | null;
}
CallbackEventListener
(EventListener & {
(event: CallbackEvent<TTagName, TEvent>): void;
}) | null
CallbackEvent
TEvent & {
currentTarget: HTMLElementTagNameMap[TTagName];
}
Code
examples
Code
<s-button variant="secondary">Cancel</s-button> <s-button variant="primary">Save</s-button>
Preview

Anchor to best-practicesBest Practices
Content Best Practices
Clearly label each button to accurately represent the action associated with it.
Use strong actionable verbs at the beginning of button text to make it clear to the user what action will occur when the button is clicked.
Hierarchy Best Practices
Establish a visual hierarchy between buttons to minimize confusion and help users understand which actions are most important.
Use only one high-emphasis button (primary button) per context to make it clear that other buttons have less importance.
Use lower-emphasis buttons for secondary calls to action.
Use primary buttons for actions that progress users through checkout such as “Pay now” or for concluding an action in a modal such as “Apply”.
Use secondary buttons to provide alternative actions to the primary button, without disrupting the primary flow such as “Track your order”.
When to Use Buttons
Use buttons to communicate actions the user can take.
Use buttons to allow users to interact with the page.
When Not to Use Buttons
- Don’t use buttons as navigational elements. Use links instead when the desired action is to take the user to a new page.