Switch
tetra-ui/switchFreeComponent
A control that allows users to toggle between checked and unchecked states.
Live preview
live · rendered by the registry
Rendered by tetra-ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://tetra-ui.com/r/switch.jsonSource
1import {2 Host as HostPrimitive,3 Switch as SwitchPrimitive,4 type SwitchProps as SwitchPrimitiveProps,5} from "@expo/ui";6import { tint } from "@expo/ui/swift-ui/modifiers";7import { useCSSVariable } from "uniwind";89// Types10type SwitchProps = Omit<SwitchPrimitiveProps, "modifiers">;1112// Components13export const Switch = (props: SwitchProps) => {14 const primaryColor = useCSSVariable("--color-primary") as string;15 return (16 <HostPrimitive matchContents>17 <SwitchPrimitive {...props} modifiers={[tint(primaryColor)]} />18 </HostPrimitive>19 );20};
What it pulls in
npm packages
Files it writes
More from tetra-ui
All 41 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | tetra-ui | Components | Free | 1 dep | |
| Action Inputaction-input | tetra-ui | Components | Free | no deps | |
| Alertalert | tetra-ui | Components | Free | no deps | |
| Avataravatar | tetra-ui | Components | Free | no deps | |
| Badgebadge | tetra-ui | Components | Free | no deps | |
| Bottom Sheetbottom-sheet | tetra-ui | Components | Free | 4 deps · 7 files | |
| Buttonbutton | tetra-ui | Components | Free | no deps | |
| Cardcard | tetra-ui | Components | Free | no deps |
