[**Documentation**](../../../../README)

***

[Documentation](../../../../README) / [@zerotal/flow](../../README) / [index](../README) / Switch

# Function: Switch()

> **Switch**(`props`): [`HtmlNode`](../type-aliases/HtmlNode)

Defined in: [flow/src/headless.ts:51](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/headless.ts#L51)

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`](../interfaces/SwitchProps)

## Returns

[`HtmlNode`](../type-aliases/HtmlNode)

## Example

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