Toggle
A two-state button that can be on or off.
API reference
Import the component and use it as a single part:
Anatomy
import { Toggle } from '@base-ui-components/react/toggle';
<Toggle />| Prop | Type | Default | |
|---|---|---|---|
aria-label | 
  | 
  | |
aria-labelledby | 
  | 
  | |
value | 
  | 
  | |
defaultPressed | 
  | 
  | |
pressed | 
  | 
  | |
onPressedChange | 
  | 
  | |
disabled | 
  | 
  | |
className | 
  | 
  | |
render | 
  | 
  | 
| Attribute | Description  | |
|---|---|---|
data-pressed | Present when the toggle button is pressed.  | |