tetra-ui Logotetra ui

Switch

A control that allows users to toggle between checked and unchecked states.

switch

Installation

npx shadcn@latest add @tetra-ui/switch

Usage

import { Switch } from "@/components/ui/switch";
<Switch />

Controlled

Pass value and onValueChange for controlled state:

const [enabled, setEnabled] = useState(false);

<Switch value={enabled} onValueChange={setEnabled} />

Disabled

<Switch disabled value />

Changelog

2026-06-01 Migrate to Expo UI

Migrate to Expo UI Switch component.

On this page