Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/mui/base-ui/llms.txt

Use this file to discover all available pages before exploring further.

Switch

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

Import

import * as Switch from '@base-ui/react/switch';

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).

Build docs developers (and LLMs) love