Switch

The Switch component is used as an alternative for the checkbox component.

The Switch component is used as an alternative for the Checkbox component. You can switch between enabled or disabled states.

Switch must always be accompanied by a label, and follows the same keyboard workflow as a Checkbox.

Import#

import { Switch } from '@chakra-ui/react'

Usage#

Sizes#

Pass the size prop to change the size of the Switch.

Switch background color#

You can change the checked background color of the Switch by passing the colorScheme prop.

State depending behavior#

States like isDisabled have an impact on the usability of a Switch and on the styles, except for the isInvalid and the isRequired prop.

Proudly made inNigeria by Segun Adebayo

Deployed by Vercel