Toggle Button

A two-state button that can be either on or off.

Features

  • Full keyboard navigation.
  • Can be controlled or uncontrolled.

Install the component from your command line.

Import the component.

Create your styled toggle button component from the primitive parts.

The toggle button.

PropTypeDefaultRequired
asenumbutton
defaultToggledboolean
toggledboolean
onToggledChangefunction
disabledboolean
KeyDescription
SpaceActivates/deactivates the toggle button.
EnterActivates/deactivates the toggle button.