Switch
A pill track and a round thumb that travels in 180ms.
<Switch label="Send budget alerts" description="Email owners at 80% and 100% of the monthly budget." defaultChecked className="w-400" />import { Switch } from "@logicplanes/kaeso-ui";Props
aria-labelstringThe accessible name, for when there is no visible label.
aria-labelledbystringThe id of the element that names it, when its label is elsewhere on the page.
checkedbooleanWhether it is checked, when you control it.
defaultCheckedbooleanWhether it starts checked, when the component keeps its own state.
descriptionReactNodeOne sentence of help under the label.
disabledbooleanTurns it off: it can't be used, and it looks dimmed.
disabledReasonstringWhy it is disabled, shown as a tooltip; it stays focusable so people can read it.
idstringThe id of the control, so a label elsewhere can point to it.
labelReactNodeThe switch's label.
loadingbooleanShows that the change is being saved and ignores clicks until it is.
namestringThe field name the value is sent under in a form.
onCheckedChange((checked: boolean) => void)Called with the new state when it is checked or unchecked.
readOnlybooleanShows the value without letting people change it.
size"md" | "sm" | "lg" = mdThe switch's size.