NexoreUIv1.4
InstallationComponents41IconsNexore MakeAI
Create ProjectSTUDIOGitHub
NexoreUI
41 comps
Create Project
Studio
Installation
Components Overview
40+
Icons
300+
Categories6 groups
Button
Input
Switch
Slider
Rating
File Upload
Card
Accordion
Tabs
Table
Stepper
Scroll Area
Navigation
Dock
Data Display
Thinking Indicator
AI
Tool Call Card
AI
Agent Status Pill
AI
Command
Theme: indigo
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

Disabled Switch

component.tsx

With Label & Description

component.tsx

Settings Row Card

Receive real-time alerts in this browser.

component.tsx

Animated Toggle Switch (Hero)

component.tsx

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.