byronwade/ui
Application UI

Forms · Application UI

Toggle Group

Single- or multi-select group of toggle buttons sharing variant/size context.

@byronwade/foundation@byronwade/utils@byronwade/toggle@base-ui/reactclass-variance-authority

Feature showcase

Installation

Features

  • 6 examples

    Default, Multiple, Variants, Sizes, Vertical, Disabled.

API

Props

PropTypeDefaultDescription
valuestring[]-Controlled array of pressed item values.
defaultValuestring[]-Uncontrolled initial pressed values.
onValueChange(value: string[]) => void-Fires when the pressed items change.
multiplebooleanfalseAllow more than one item pressed at once.
variant"default" | "outline""default"Visual style shared by all items.
size"default" | "sm" | "lg""default"Item size shared by all items.
orientation"horizontal" | "vertical""horizontal"Layout axis of the group.
disabledbooleanfalseDisable the entire group.

Dependencies

PackageKindDescription
@byronwade/foundationregistryInstalled through the byronwade/ui registry.
@byronwade/utilsregistryInstalled through the byronwade/ui registry.
@byronwade/toggleregistryInstalled through the byronwade/ui registry.
@base-ui/reactnpmInstalled from npm.
class-variance-authoritynpmInstalled from npm.

Source and related

FilePath
Componentregistry/ui/toggle-group.tsx
Default examplecontent/examples/toggle-group/default.tsx
Multiple examplecontent/examples/toggle-group/multiple.tsx
Variants examplecontent/examples/toggle-group/variants.tsx
Sizes examplecontent/examples/toggle-group/sizes.tsx
Vertical examplecontent/examples/toggle-group/vertical.tsx
Disabled examplecontent/examples/toggle-group/disabled.tsx