# UI: Switch

> An on and off switch for settings that apply at once.

Source: https://pithyx.org/docs/reference/sdk/ui/switch/
Markdown: https://pithyx.org/docs/reference/sdk/ui/switch.md

An on and off switch for settings that apply at once. Import the token file once (`@pithyx/ui/tokens.css`) and wrap the app in `UiProvider`; see [@pithyx/ui](https://pithyx.org/docs/sdk/ui/).

Generated from the TSDoc comments of @pithyx/ui 1.0.0-rc.9 at build time; the text below the headings is the comment in the source.

## Interfaces

### SwitchProps

The props of [Switch](#switch): React Aria's switch field props plus the label.

#### Extends

- `Omit`\<`SwitchFieldProps`, `"className"` \| `"children"`\>

#### Properties

##### children

```ts
children: ReactNode;
```

The label, also the accessible name.

## Functions

### Switch()

```ts
function Switch(props): Element;
```

An on and off switch with its label, for settings that apply at once.

#### Parameters

| Parameter | Type                          | Description                                                                              |
| --------- | ----------------------------- | ---------------------------------------------------------------------------------------- |
| `props`   | [`SwitchProps`](#switchprops) | React Aria's switch field props (`isSelected`, `onChange`, `isDisabled`) plus the label. |

#### Returns

`Element`

The switch with its label.
