ZuploZuplo
LoginStart for Free
  • Documentation
  • API Reference
Getting Started
Concepts
API Management
AI Gateway
MCP Gateway
MCP Server
Developer Portal
    Overview
    Getting Started
      Updating VersionsNode Modules & CustomizationZuplo Branding
      Configuration
      Writing
      OpenAPI
      Authentication
      Integrations
      Guides
      Extending
      Components
        General
        Documentation
        Form
          ButtonCheckboxSliderSwitchLabel
        Utility
    Development
    Deploying & Source Control
    Analytics
    Observability
    Networking & Infrastructure
    Account Management
    Programming API
    Build with AI
    Zuplo CLI
    Migration Guides
    Platform LimitsVersion Support PolicySecuritySupportTrust & ComplianceChangelog
    powered by Zuplo
    Form

    Switch

    A switch component built on Radix UI primitives for boolean toggle input.

    Import

    Code
    import { Switch } from "zudoku/ui/Switch";

    Basic Usage

    Code
    <Switch />

    With Label

    Code
    <div className="flex items-center space-x-2"> <Switch id="airplane-mode" /> <Label htmlFor="airplane-mode">Airplane Mode</Label> </div>

    Checked State

    Code
    <div className="flex items-center space-x-2"> <Switch id="airplane-mode-2" defaultChecked /> <Label htmlFor="airplane-mode-2">Airplane Mode</Label> </div>

    Disabled State

    Code
    <div className="flex items-center space-x-2"> <Switch id="airplane-mode-3" disabled /> <Label htmlFor="airplane-mode-3">Airplane Mode</Label> </div>

    With Description

    Receive emails about new products, features, and more.

    Code
    <div className="flex items-center justify-between"> <div className="space-y-0.5"> <Label htmlFor="marketing-emails">Marketing emails</Label> <div className="text-sm text-muted-foreground"> Receive emails about new products, features, and more. </div> </div> <Switch id="marketing-emails" /> </div>

    Features

    • Accessibility: Full keyboard navigation and screen reader support
    • Smooth Animation: Smooth transition between states
    • Controlled/Uncontrolled: Can be used with or without state management
    • Touch Friendly: Optimized for touch interactions
    Edit this page
    Last modified on October 1, 2026
    SliderLabel
    On this page
    • Import
    • Basic Usage
    • With Label
    • Checked State
    • Disabled State
    • With Description
    • Features
    React
    React
    React
    React
    React
    React