Docs / Components
SenseIconButtonComponent
Icon-only action control from @artificialsenselabs/ui for toolbars, field affordances, and dismiss actions. Composes sense-icon inside a labelled native <button>.
Live demo: run nx serve showcase and open /components/icon-button (port 4202).
Overview
Category: Action / primitives. Selector: sense-icon-button. Import: import { SenseIconButtonComponent } from '@artificialsenselabs/ui';
<sense-icon-button
icon="search"
ariaLabel="Search"
variant="ghost"
/>API
Generated from libs/ui/src/lib/icon-button/sense-icon-button/sense-icon-button.component.ts — run pnpm run docs:api to refresh.
| Input | Type | Default | Description |
|---|---|---|---|
icon | SenseIconName | required | Semantic glyph rendered inside the button. |
type | SenseIconButtonType | 'button' | Native button `type` attribute. |
size | SenseIconButtonSize | 'md' | Button scale — maps to matching `sense-icon` size. |
variant | SenseIconButtonVariant | 'ghost' | Surface treatment: filled, outlined, or ghost. Legacy `primary` / `secondary` accepted. |
severity | SenseIconButtonSeverity | null | null | Optional semantic colour override for the icon and hover states. |
colordeprecated | SenseIconButtonSeverity | null | null | Legacy alias for `severity`. Deprecated: Prefer `severity`. |
disabled | boolean | false | Disables pointer interaction and dims the control. |
loading | boolean | false | Shows spinner glyph, sets `aria-busy`, and disables interaction. |
ariaLabel | string | required | Accessible name — required because there is no visible label text. |
loadingLabel | string | null | null | Accessible name while `loading` is true; falls back to i18n `icon-button.loading`. |
autofocus | boolean | false | Focuses the native button after the first render when true. |
| Output | Type | Description |
|---|---|---|
clicked | MouseEvent | Emitted when the native button is clicked and not disabled/loading. |
buttonFocus | FocusEvent | Emitted when the native button receives focus. |
buttonBlur | FocusEvent | Emitted when the native button loses focus. |
Accessibility
- APG:Button pattern — icon-only buttons require
ariaLabel. - Inner
sense-iconis decorative; the native button carries the accessible name. - Loading swaps the label to i18n
icon-button.loadingand setsaria-busy="true". - Focus ring uses design-token outline; hover background on ghost variant.