Skip to content

Components Forms

Switch

A checkbox that looks like a switch. The slot is its label.

$ pyblade ui:add switch

Switches

Props

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

NameTypeDefaultDescription
checked bool False Whether it starts on
size str "md" sm or md
class str "" Added to the classes of the component. Every other attribute is spread on it too.