Skip to main content

Switch

A toggle switch control that can be turned on or off.

Import

Switch.Root

Represents the switch itself.

Props

State

  • checked: boolean - Whether the switch is currently active
  • disabled: boolean - Whether the component should ignore user interaction
  • readOnly: boolean - Whether the user should be unable to activate or deactivate the switch
  • required: boolean - Whether the user must activate the switch before submitting a form

Switch.Thumb

The movable part of the switch that indicates whether the switch is on or off.

Props

Inherits common props (className, render, style).