Skip to main content
zerotal

Documentation


Documentation / @zerotal/flow / index / Switch

Function: Switch()

Switch(props): HtmlNode

Defined in: flow/src/headless.ts:51

An accessible on/off toggle (role="switch") bound to an @expose boolean: clicking (or Space/Enter) flips it and syncs to the server via $flow.$set. Unstyled — target the on-state with data-[checked]:….

Parameters

props

SwitchProps

Returns

HtmlNode

Example

<Switch bind={this.notify} class="… data-[checked]:bg-indigo-600" />