Sorry, but you either have no stories or none are selected somehow.
If the problem persists, check the browser console, or the terminal you've run Storybook from.
The component failed to render properly, likely due to a configuration issue in Storybook. Here are some common causes and how you can address them:
Spectrum website
Spectrum web components
npm
GitHub
Buttons allow users to perform an action or to navigate to another page. They have multiple styles for various needs, and are ideal for calling attention to where a user needs to do something in order to move forward in a flow.
There are four available variants that are used for different levels of emphasis and different types of actions. By default, a button uses the fill style with a solid background. The primary and secondary variants also have an outline option.
The component accepts the following inputs (properties):
Name | Description | Default |
---|---|---|
Component | ||
Size* | string | - |
Treatment | string | - |
Variant | string | - |
Content | ||
Label | string | - |
Workflow icons | string | - |
State | ||
Disabled | boolean | - |
Pending | boolean | - |
Active | boolean | - |
Focused | boolean | - |
Hovered | boolean | - |
Advanced | ||
Disable label wrap | Used to keep the button label text on one line. Note that this option is not a part of the design specifications which intend for the label to wrap. Use with care and consideration of this option's overflow behavior and the readability of the button's content. boolean | - |
Static color | Used when component is layered over a background or visual contrary to the general theme. string | - |
These are empty CSS custom property hooks available in this component that enable one-off customizations specific to a product implementation.
Property |
---|
--mod-button-animation-duration |
--mod-button-background-color-default |
--mod-button-background-color-disabled |
--mod-button-background-color-down |
--mod-button-background-color-focus |
--mod-button-background-color-hover |
--mod-button-border-color-default |
--mod-button-border-color-disabled |
--mod-button-border-color-down |
--mod-button-border-color-focus |
--mod-button-border-color-hover |
--mod-button-border-radius |
--mod-button-border-width |
--mod-button-bottom-to-text |
--mod-button-content-color-default |
--mod-button-content-color-disabled |
--mod-button-content-color-down |
--mod-button-content-color-focus |
--mod-button-content-color-hover |
--mod-button-edge-to-text |
--mod-button-edge-to-visual |
--mod-button-edge-to-visual-only |
--mod-button-focus-ring-border-radius |
--mod-button-focus-ring-color |
--mod-button-focus-ring-gap |
--mod-button-focus-ring-thickness |
--mod-button-font-family |
--mod-button-font-size |
--mod-button-font-weight |
--mod-button-height |
--mod-button-icon-margin-block-start |
--mod-button-line-height |
--mod-button-margin-block |
--mod-button-margin-left |
--mod-button-margin-right |
--mod-button-max-inline-size |
--mod-button-min-width |
--mod-button-padding-label-to-icon |
--mod-button-text-align |
--mod-button-text-align-with-icon |
--mod-button-top-to-icon |
--mod-button-top-to-text |
latest
next
s2-foundations
beta