Skip to main content

SpSwitch

Function SpSwitch 

Source
pub fn SpSwitch(_: SpSwitchProps) -> Element
Expand description

A labeled on/off toggle.

Maps to <sp-switch>; slotted children render as its label. checked renders its current state; onclick fires on every toggle press, mirroring SpActionButton’s selected/onclick pattern (the caller owns the boolean state and re-renders checked from it) rather than reading the new state back off a native change event.

§Props

For details, see the props struct definition.