Skip to main content

Function: ToggleButton()

ToggleButton(__namedParameters): any

Defined in: components/ToggleButton/ToggleButton.tsx:118

A two-state toggle button (Action entity). Unlike Button, its selection is persistent: the engaged state renders the pressed color (not the transient active), and React Aria exposes it via aria-pressed.

Use for toolbar toggles ("Bold", "Italic") and single on/off controls that read as buttons. For a set of mutually-related toggles, wrap them in ToggleButtonGroup.

Parameters

ParameterType
__namedParametersToggleButtonProps

Returns

any

Example

<ToggleButton>Bold</ToggleButton>
<ToggleButton defaultSelected>Grid view</ToggleButton>