Skip to content

Toggle

A two-state button that can be either on or off.

Examples

Default

vue
<Toggle aria-label="Toggle bold">
  <Bold class="h-4 w-4" />
</Toggle>

Outline

vue
<Toggle variant="outline" aria-label="Toggle bold">
  <Bold class="h-4 w-4" />
</Toggle>

With Text

vue
<Toggle aria-label="Toggle italic">
  <Bold class="mr-2 h-4 w-4" />
  Bold
</Toggle>

Props

Toggle

PropTypeDefaultDescription
pressedboolean-The controlled pressed state of the toggle.
defaultPressedbooleanfalseThe default pressed state of the toggle.
disabledbooleanfalseWhether the toggle is disabled.

Slots

Toggle

SlotDescription
defaultThe content of the toggle.