On this page
API ReferenceToggleGroupToggleItem

ToggleGroup#

Github

Toggle Group is a collection of toggle buttons that supports the 'on' or 'off' state of a single or multiple toggle buttons.

import { ToggleGroup, ToggleItem } from "wis/toggle"

API Reference#

ToggleGroup#

NameTypeDefaultDescription
variantbasic compactbasicThe visual variant to apply to toggle group.
disabledbooleanfalseWhen true, prevents the user from interacting with the toggle item in toggle group.
sizemd smmdThe size of the toggle group.
valuestring string[]noneThe value of selected item in the group. Must be used in conjunction with onChange.
defaultValuestring string[]noneThe default value of selected item in the group.
multiplebooleanfalseWhen true, allows multiple items to be selected.
onChange(value: string | string[]) => voidnoneEvent handler called when the toggle group item press state changed.

ToggleItem#

NameTypeDefaultDescription
textstringnoneThe text information displayed on the toggle item.
disabledbooleanfalseWhen true, prevents the user from interacting with the toggle item.
iconReactNodenoneThe icon element will be displayed next to the toggle item text.
iconControlprefix suffixprefixControls the display position of the icon relative to the text.
valuebooleannoneThe unique value of the toggle item.
shortcutKeystringnoneSets a global shortcut key, such as Control+I. When the user presses the combination key, the toggle item's click event will be triggered. View Keyboard