Skip to content

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 ​

PropTypeDefaultDescription
modelValueboolean | null—Pressed or not; two-way via v-model
defaultValuebooleanfalseStarting state when uncontrolled
size'xs' | 'sm' | 'md' | 'lg' | 'xl''md'Matches IButton
squarebooleanfalseIcon-only; drops the horizontal padding
blockbooleanfalseStretch to the container width
disabledbooleanfalse
unstyledboolean—Skip built-in classes

Events ​

EventPayload
update:modelValueboolean

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.