Skip to content

UI: Switch

View as Markdown

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.

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.

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 Type Description
props SwitchProps React Aria’s switch field props (isSelected, onChange, isDisabled) plus the label.

Element

The switch with its label.