UI Componentsprimitives

Switch

Radix-based toggle switch component.

Preview placeholder

switch

Installation

Terminal
npx @ontopic/viz add ui/generic/switch

Props

PropTypeDescription
checkedbooleanControlled checked state
onCheckedChangefunctionChange handler

See full TypeScript interface on GitHub for all props.

Usage Example

TypeScript
import { Switch } from '@/viz/ui/generic/switch';

Metadata

  • Last Updated2025-01-12
  • FrameworkUI Components
  • Categoryprimitives
  • Subcategorygeneric
UI Radix Toggle Form

Dependencies

@radix-ui/react-switch

Quick Install

npx @ontopic/viz add ui/generic/switch