Button
Themeable button with slots for text, prefix, suffix and running icons.
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
disabled | boolean | false | Disables the button: it no longer receives clicks and is rendered dimmed. |
running | boolean | false | Marks the button as busy: clicks are ignored and the `running-icon` slot replaces the prefix icon. |
selected | boolean | false | Pressed state of a toggle button (`aria-pressed="true"`); styled with the `container__selected--*` variables. |
toggle | boolean | false | Declares a toggle button: `aria-pressed` is announced as `false` while not selected. Set by `c2-button-group` in selection modes. |
CSS custom properties
Grouped by the element and state they target. Click a group to collapse it; click a name to copy it.
| Name | Type | Default | Description |
|---|---|---|---|
--c2-button__container--height | pixel | 36px | |
--c2-button__container--padding-left | padding | 16px | |
--c2-button__container--padding-right | padding | 16px | |
--c2-button__container--gap | pixel | 8px | |
--c2-button__container--border-radius | border-radius | 6px | |
--c2-button__container--border | border | 1px solid transparent | |
--c2-button__container--background-color | color | rgb(2, 101, 220) | |
--c2-button__container--color | color | #ffffff | |
--c2-button__container--font-size | pixel | 14px | |
--c2-button__container--font-weight | font-weight | 500 | |
--c2-button__container__hover--background-color | color | rgb(1, 84, 184) | |
--c2-button__container__hover--color | color | — | |
--c2-button__container__hover--border | border | — | |
--c2-button__container__active--background-color | color | rgb(1, 70, 154) | |
--c2-button__container__selected--background-color | color | — | Pressed state of a toggle button (see `selected`). |
--c2-button__container__selected--color | color | — | |
--c2-button__container__selected--border | border | — | |
--c2-button__container__focus--outline | outline | 2px solid rgba(2, 101, 220, 0.4) | |
--c2-button__container__focus--outline-offset | pixel | 2px | |
--c2-button__container__disabled--opacity | opacity | 0.38 | |
--c2-button__icon--size | pixel | 18px | |
--c2-button__icon--color | color | — | |
--c2-button__running-icon--size | pixel | 18px | |
--c2-button__running-icon--color | color | — | |
--c2-button__running-icon--animation-duration | duration | 800ms | |