Leave Yamada UI a star

Star
Yamada UIYamada UIv1.6.5

Toggle

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

Source@yamada-ui/toggle

Props

ToggleProps

colorScheme

Description

The visual color appearance of the component.

Type

"blackAlpha" | "whiteAlpha" | "amber" | "blue" | "info" | "link" | "primary" | "cyan" | "emerald" | "flashy" | "fuchsia" | "gray" | "green" | "success" | "indigo" | "lime" | "neutral" | "orange" | "warning" | "pink" | "purple" | "red" | "danger" | "rose" | "sky" | "teal" | "violet" | "secondary" | "yellow"

Default

"gray"

defaultIsSelected

Description

If true, the toggle button will be initially selected.

Type

boolean

Default

false

disableRipple

Description

If true, disable ripple effects when pressing a element.

Type

boolean

Default

false

icon

Description

The icon to be used in the button.

Type

ReactElement<any, string | JSXElementConstructor<any>>

isActive

Description

If true, the toggle button is represented as active.

Type

boolean

Default

false

isDisabled

Description

If true, the toggle button will be disabled.

Type

boolean

Default

false

isReadOnly

Description

If true, the toggle button will be readonly.

Type

boolean

Default

false

isRounded

Description

If true, the toggle button is full rounded. Else, it'll be slightly round.

Type

boolean

Default

false

isSelected

Description

If true, the toggle button will be selected.

Type

boolean

onChange

Description

The callback invoked when selected state changes.

Type

(isSelected: boolean) => void

size

Description

The size of the Toggle.

Type

"xs" | "sm" | "md" | "lg"

Default

"md"

value

Description

The value of the toggle button.

Type

Y

variant

Description

The variant of the Toggle.

Type

"outline" | "solid" | "subtle" | "unstyled"

Default

"subtle"

ToggleGroupProps

defaultValue

Description

The initial value of the toggle button group.

Type

NonNullable<Y extends any[] ? Y : Y | undefined>

direction

Description

The CSS flex-direction property.

Type

"-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "column" | "column-reverse" | "row" | "row-reverse" | [FlexDirection | { [x: string]: FlexDirection | undefined; ... 5 more ...; xl?: FlexDirection | undefined; }, FlexDirection | { ...; }] | { ...; } | [...] | { ...; } | ((theme: StyledT...

isDisabled

Description

If true, all wrapped toggle button will be disabled.

Type

boolean

Default

false

isReadOnly

Description

If true, all wrapped toggle button will be readonly.

Type

boolean

Default

false

onChange

Description

The callback fired when any children toggle button is selected or unselected.

Type

(value: Y extends any[] ? Y : Y | undefined) => void

value

Description

The value of the toggle button group.

Type

NonNullable<Y extends any[] ? Y : Y | undefined>

Edit this page on GitHub

PreviousSwitchNextSelect