Icon Button
Round, hoverable button wrapping a slotted SVG icon.
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
tooltip | string | undefined | undefined | Tooltip text shown after a short delay; also used as the accessible name when aria-label is not set. |
disabled | boolean | false | Disables the button: no pointer events, no focus, reduced opacity. |
aria-label | string | null | null | Accessible name forwarded to the inner <button>. |
selected | boolean | false | Pressed state of a toggle button (aria-pressed="true"); styled with the __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. |
Slots
| Name | Description |
|---|---|
(default) | The icon (an inline <svg>, a c2-feather-* or a c2-mat-icon element). |
CSS parts
Shadow DOM styling hooks used with ::part(name). Prefer CSS custom properties when they cover the change.
| Name | Description |
|---|---|
button | The native button that provides the icon-only interactive surface. |
CSS custom properties
Grouped by semantic target and state from --c2-<component>__<target>__<state>--<property>. Click a group to collapse it; click a name to copy it.
| Name | Type | Default | Description |
|---|---|---|---|
--c2-icon-button--background-color | color | — | |
--c2-icon-button--border-radius | border-radius | 999px | |
--c2-icon-button--border | border | none | |
--c2-icon-button__hover--background-color | color | rgb(230, 230, 230) | |
--c2-icon-button__focus--outline | outline | 2px solid rgba(2, 101, 220, 0.4) | |
--c2-icon-button__focus--outline-offset | pixel | 2px | |
--c2-icon-button__disabled--opacity | opacity | 0.38 | |
--c2-icon-button__selected--background-color | color | rgb(230, 230, 230) | Pressed state of a toggle button (see selected). |
--c2-icon-button__icon--width | pixel | 24px | |
--c2-icon-button__icon--height | pixel | 24px | |
--c2-icon-button__icon--color | color | — | |
--c2-icon-button__icon__hover--color | color | — | |
--c2-icon-button__icon__selected--color | color | — | |
--c2-icon-button__state-layer--size | pixel | 48px | |