NexoreUI
2.0
InstallationComponentsIconsTemplatesNewNexore MakePricing
Create Project
GitHub
NexoreUI
2.0
Navigation
InstallationComponentsIconsTemplatesNexore MakeCreate Project
InstallationComponents OverviewIcons
Categories (65)
ButtonInputCheckboxSelectSwitchSliderRatingFile Upload
CardAccordionTabsTableStepperScroll AreaNavigationDockData DisplayChartsCommerce
Modal (Dialog)AlertBadgeAvatarTooltipProgressSkeletonLoadersToasterSocial
Aurora Border CardAurora Search PillAI Prompt InputCommandInteractive Code BlockPro AI
Media ShowcaseOverlays & DrawersPro ButtonsPro DashboardsPro E-CommercePro FeedbackPro FormsPro InputsPro LayoutsPro ListsPro MarketingPro NavigationPro TablesSpecial FormsUltra Components
OverviewPro CardsPro ObjectsSoundPulseSilkUnveilNode Flow Graph
NexoreUI v2.0Studio
DocsSwitch

Switch

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

PreviousInput
NextSlider
On This Page
Quick ActionsProject StudioNewNexore 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.