Skip to content

ToggleProps

ToggleProps are the props of ReactComponent.Toggle. The wrapper’s type declarations do not cover this component, so the props come from Spotify’s settings page.

type ToggleProps = {
value: boolean;
onSelected: (value: boolean) => void;
disabled?: boolean;
id?: string;
className?: string;
};
PropDescription
valuetrue when the toggle is on.
onSelectedRuns with the new value when the user clicks the toggle.
disabledDisables the toggle.
idThe input’s ID, which a <label htmlFor> can point to.
classNameExtra class names.