Caprice LogoCaprice UI

Toggle Group

Provides a shared state to a series of toggle buttons.

Installation

npx shadcn@latest add @caprice/toggle-group

Usage

import * as ToggleGroup from "@/components/caprice-ui/togglegroup"
<ToggleGroup.Root>
  <ToggleGroup.Item value="a">A</ToggleGroup.Item>
  <ToggleGroup.Item value="b">B</ToggleGroup.Item>
  <ToggleGroup.Item value="c">C</ToggleGroup.Item>
</ToggleGroup.Root>

Examples

Outline

Multiple

By default, only one item in the group can be pressed. If any item in the group becomes pressed, the others will become unpressed. You can use the multiple prop to allow multiple items to be pressed.

Small

Large

Disabled

Spacing