smrt
Open the smrt source on GitHub Switch to dark color scheme
← All UI components

Actions and display

IconToggle

An icon-only toggle button for dense filter and view-switcher rows. The icon is the `children` snippet (any icon set); `label` is both the accessible name and the tooltip text. `pressed` is reflected with `aria-pressed`, so a row of them is a one-of-many (or a many) toggle group; the owner decides what pressing means (this component keeps no state).

Public export

typescript
import { IconToggle } from '@happyvertical/smrt-ui/ui';
Import path
@happyvertical/smrt-ui/ui
Props
7
Props described
7 of 7
Bindable state
0
Callback events
0
Verified release
0.62.10

Props

Also accepts Omit<HTMLButtonAttributes, 'class' | 'children' | 'aria-label' | 'aria-pressed' | 'title'>. The table lists the component-specific contract.

NameTypeRequiredDescription
labelstringYesAccessible name and tooltip text (what the button does or filters).
pressedbooleanNoWhether the toggle is on (`aria-pressed`).
countnumberNoOptional count badge; included in the accessible name and tooltip.
tonestringNoA CSS colour (a token such as `var(--smrt-color-primary)` or a value) shown when the toggle is pressed.
childrenSnippetYesThe icon. Decorative: it is hidden from assistive technology.
tooltipPlacementTooltipPlacementNoWhere the tooltip opens.
classstringNoAdditional CSS class names.

Bindable state

This component has no bindable public state.

Callback events

This component declares no callback event props.

Examples and explanation