# UI: Switch

> Ein Schalter für Einstellungen, die sofort gelten.

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

Ein Schalter für Einstellungen, die sofort gelten. Importiere die Token-Datei einmal (`@pithyx/ui/tokens.css`) und umschließe die App mit `UiProvider`; siehe [@pithyx/ui](https://pithyx.org/de/docs/sdk/ui/).

Beim Build aus den TSDoc-Kommentaren von @pithyx/ui 1.0.0-rc.9 erzeugt; der Text unter den Überschriften ist der Kommentar im Quelltext und bleibt Englisch.

## Schnittstellen

### SwitchProps

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

#### Erweitert

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

#### Eigenschaften

##### children

```ts
children: ReactNode;
```

The label, also the accessible name.

## Funktionen

### Switch()

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

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

#### Parameter

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

#### Rückgabewert

`Element`

The switch with its label.
