Skip to content

Toggle ​

Overview ​

A toggle button built on Reka UI's Toggle, supporting variant and size styles via the theme system.

Theme entry: Toggle

Props ​

NameTypeRequiredDefaultDescription
themeOverrideObjectnullA partial ThemeObject keyed by component name, merged over this component's theme and provided to descendants.
classimport('vue').HTMLAttributes['class']undefinedAdditional CSS classes to apply to the root element.
variantstring"default"Visual style variant.
sizestring"default"Size variant.
pressedbooleanundefinedWhether the toggle is pressed.
defaultPressedbooleanundefinedThe default pressed state.
disabledbooleanfalseWhether the toggle is disabled.
asstring|objectundefinedThe element or component to render as.
asChildbooleanfalseWhen true, merges props onto the child element instead of rendering a wrapper.

Slots ​

default ​

Scoped slot.

Events ​

NameDescription
update:pressedEmitted when the pressed state changes.

Full event reference

Source ​

client/lib/controls/toggle/Toggle.vue