Forms
IToggle
A button that stays pressed — bold in an editor, a filter that is either on or off. For a setting rather than an action, use ISwitch.
Content comes from the default slot, as in IButton — an icon, a label, or both. Mark an icon with data-icon="inline-start" or "inline-end" and the padding tightens on that side.
Sizes
The heights match IButton, so the two line up in a toolbar.
Icon-only
square drops the horizontal padding, so the icon needs no data-icon mark. With no text to name it, pass an aria-label.
Uncontrolled
Leave v-model off and pass default-value to let the toggle keep its own state.
vue
<IToggle default-value>Notifications</IToggle>Disabled
Props
| Prop | Type | Default | Description |
|---|---|---|---|
modelValue | boolean | null | — | Pressed or not; two-way via v-model |
defaultValue | boolean | false | Starting state when uncontrolled |
size | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'md' | Matches IButton |
square | boolean | false | Icon-only; drops the horizontal padding |
block | boolean | false | Stretch to the container width |
disabled | boolean | false | |
unstyled | boolean | — | Skip built-in classes |
Events
| Event | Payload |
|---|---|
update:modelValue | boolean |
Accessibility
The toggle renders a <button> carrying aria-pressed, reachable by Tab and operated with Space or Enter. Attributes you set land on that button, so aria-label names the control.