ZuploZuplo
LoginSign Up
  • Documentation
  • API Reference
Introduction
Getting Started
    Develop using the Portal
      1 - Setup Your Gateway2 - Rate Limiting3 - API Key Auth4 - Deploy5 - Dynamic Rate LimitingMCP - Quick start
    Develop Locally
      1 - Setup Your Gateway2 - Rate Limiting3 - API Key Auth
Concepts
Development
Policies
Handlers
API Keys
MCP Server
MCP Gateway
AI Gateway
Developer Portal
    IntroductionLocal DevelopmentUpdating VersionsNode Modules & Customization
    Configuration
    Writing
    OpenAPI
    Authentication
    Integrations
    Guides
    Extending
    Components
      General
      Documentation
      Form
        ButtonCheckboxSliderSwitchLabel
      Utility
Monetization
Deploying & Source Control
Observability
Networking & Infrastructure
Account Management
Programming API
Build with AI
Zuplo CLI
Migration Guides
Platform LimitsSecuritySupportTrust & ComplianceChangelog
powered by Zudoku
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 May 29, 2026
SliderLabel
On this page
  • Import
  • Basic Usage
  • With Label
  • Checked State
  • Disabled State
  • With Description
  • Features
React
React
React
React
React
React