Documentation

Asgard

Getting started

Theming

Guides

Layout

Docking

Inputs & forms

Button

Switch

Checkbox

Radio

Select

Slider

TextBox

Upload

ImageCropper

Pickers

Color picker

Calendar

Time picker

DateTime input

Data display

Card

Accordion

Typography

Progress

DataTable

TreeView

SyntaxColor

MarkdownRenderer

Terminal

Layout & docking

Grid

Splitter

SDiv

Dock

Theme switcher

Media query

Feedback & overlays

Alert

Toast

Tooltip

Popups

Drawer

FloatingPanel

FloatingWindow

Navigation & chrome

Breadcrumb

Stepper

Toolbar

Ribbon

ContextMenu

FeatureTour

Documentation

Asgard

Getting started

Theming

Guides

Layout

Docking

Inputs & forms

Button

Switch

Checkbox

Radio

Select

Slider

TextBox

Upload

ImageCropper

Pickers

Color picker

Calendar

Time picker

DateTime input

Data display

Card

Accordion

Typography

Progress

DataTable

TreeView

SyntaxColor

MarkdownRenderer

Terminal

Layout & docking

Grid

Splitter

SDiv

Dock

Theme switcher

Media query

Feedback & overlays

Alert

Toast

Tooltip

Popups

Drawer

FloatingPanel

FloatingWindow

Navigation & chrome

Breadcrumb

Stepper

Toolbar

Ribbon

ContextMenu

FeatureTour

Inputs & forms

Flip a setting on or off, instantly.

Switch is a toggle component offering three distinct visual styles that mimic Material UI, iOS, and Android designs.

Key features:

  • Three switchStyle options: mui, ios, android
  • SwitchGroup for consistent layout of multiple switches
  • Semantic coloring and configurable labelPosition
  • Three sizes with disabled state support
Loading preview…
When to use it
  • Settings and preference toggles
  • Enabling or disabling a feature live
  • Row-level on/off in a settings list
  • Platform-styled toggles (iOS / Android / MUI)
Properties
PropTypeDefaultDescription
checkedbooleanWhether the switch is currently toggled on.
onChange(checked: boolean) => voidCallback fired when the switch is toggled. The handler receives the new value directly, NOT a DOM event (write onChange={(v) => setX(v)}, not e.target.value).
labelstringText label displayed next to the switch.
size'small' | 'normal' | 'large''normal'Controls the overall size of the switch.
type'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'info'Semantic color type applied to the switch.
switchStyle'mui' | 'ios' | 'android''mui'Visual style of the switch track and thumb.
disabledbooleanfalseDisables the switch, preventing user interaction.
labelPosition'left' | 'right''right'Controls whether the label appears to the left or right of the switch.
Notes
  • The three switchStyle options (mui, ios, android) each provide a distinct visual appearance mimicking their respective platform toggles.
  • SwitchGroup provides consistent spacing and layout for multiple switches but does not manage their state.
  • Combine switchStyle with semantic type coloring to match your application design system.
Presets