Toggle Sidebar B
AppearanceLight & dark mode D

Toggle

Two-state pressable button. Use inside toolbars for formatting controls (bold, italic, align).

Default

Pressable two-state button.

Replay preview

Variants

default and outline.

Replay preview

Sizes

sm, default, lg.

Replay preview

With text

An icon followed by a text label.

Replay preview

Disabled

The disabled attribute blocks interaction.

Replay preview

API Reference

Toggle

PropTypeDefaultDescription
modelValuebooleanfalsePressed state. Supports v-model.
defaultValuebooleanfalseInitial state.
variant"default" | "outline""default"Visual style.
size"sm" | "default" | "lg""default"Size variant.
disabledbooleanfalseDisable input.
EventDescription
update:modelValueFires when the pressed state toggles. Enables v-model.

Accessibility

Keyboard shortcuts and ARIA behavior.

Shortcut Description
SpaceToggles the pressed state when focused.
EnterToggles the pressed state when focused.
TabMoves focus to or from the toggle.
  • aria-pressed reflects the on/off state.
  • Provide accessible text or an aria-label when the toggle is icon-only.