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 />
PropTypeDefault
aria-label

string

undefined

aria-labelledby

string

undefined

value

string

undefined

defaultPressed

boolean

false

pressed

boolean

undefined

onPressedChange

function(pressed: boolean, event: Event) => void

undefined

disabled

boolean

false

className

string | (state) => string

undefined

render

| React.ReactElement
| (props, state) => React.ReactElement

undefined

Attribute
Description
data-pressed