Zum Inhalt springen

UI: Switch

Als Markdown ansehen

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.

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.

The props of Switch: React Aria’s switch field props plus the label.

  • Omit<SwitchFieldProps, "className" | "children">
children: ReactNode;

The label, also the accessible name.

function Switch(props): Element;

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

Parameter Typ Beschreibung
props SwitchProps React Aria’s switch field props (isSelected, onChange, isDisabled) plus the label.

Element

The switch with its label.