NexoreUIv1.8.6
InstallationComponents61IconsTemplatesNEWNexore MakeAI
Create ProjectSTUDIOGitHub
NexoreUI
61 comps
Create Project
Studio
Installation
Components Overview
60+
Icons
300+
Categories6 groups
Button
Input
Checkbox
AI
Select
AI
Switch
Slider
Rating
File Upload
Card
Accordion
Tabs
Table
Stepper
Scroll Area
Navigation
Dock
Data Display
Aurora Border Card
AI
Aurora Search Pill
AI
AI Prompt Input
AI
Command
Interactive Code Block
AI
Pro AI
AI
Theme: cyan
Studio
DocsSwitch

Switch

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

NextSlider
On This Page
Quick Actions
Project Studio
New
Nexore Make (AI)Source on GitHub

Switch

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

When to use

toggle switchImmediate state changes (dark mode toggle, push notifications, wifi settings)
checkbox (alternative)Standard multi-select forms where actions are not applied instantly (requires a Submit button click)

Interactive Playground

Live CanvasInteractive
Controls(2)
checked
boolean
Toggle state:

The controlled state of the switch

disabled
boolean
Toggle state:

Whether the switch is interactive or not

Generated JSX
Source
import { Switch } from "nexoreui"

<Switch />

Default Switch

component.tsx
1

Disabled Switch

component.tsx
1

With Label & Description

component.tsx
1

Settings Row Card

Receive real-time alerts in this browser.

component.tsx
1

Animated Toggle Switch (Hero)

component.tsx
1

API Reference (Props)

PropTypeDefaultDescription
checkedbooleanfalseControlled checked state of the switch toggle.
defaultCheckedbooleanfalseDefault initial checked state.
onCheckedChange(checked: boolean) => void—Callback triggered when the checked state changes.
disabledbooleanfalseDisables interaction and visually mutes the switch.
namestring—Name of the input field for HTML forms integration.
valuestring—Value of the switch input element.
classNamestring—Additional custom class names.

Accessibility (a11y)

  • Keyboard Navigation: Fully focusable using Tab, and state changes on Space or Enter.
  • ARIA attributes: Uses Radix UI Switch primitive, which exports role="switch" and maps the state visually to screen readers via aria-checked.