Skip to content

Components Actions

Toggle

A button that is on or off, posted with its form as a checkbox.

$ pyblade ui:add toggle

Toggles

Props

Written as attributes of <pb-ui.toggle>; put a colon before one to pass it a Python value, as in :items="items". A slot is written <pb-slot:name>.

NameTypeDefaultDescription
name str "" The name it is posted under
value str "on" What is posted when it is on
checked bool False Whether it starts on
variant str "default" default or outline
size str "md" sm, md or lg
label str "" What screen readers call it, for a toggle that only holds an icon