Toggle

Toggle is a component that has two states: on or off.

Usage

import { Toggle, ToggleGroup } from "@yamada-ui/react"
<Toggle />
<ToggleGroup.Root>
  <ToggleGroup.Item />
</ToggleGroup.Root>

With Text

Change Variant

Change Size

Change Color Scheme

Change Shape

To change the shape, set the rounded prop.

Disable

To disable, set disabled to true.

Read-Only

To read-only, set readOnly to true.

Invalid

To set invalid state, set invalid to true.

Change Invalid Border Color

To change the border color, set errorBorderColor to the color.

Control

Grouping

For multiple selections, set value or defaultValue to an array.

Props

Accessibility

Currently, this section is being updated due to the migration of v2.