ToggleGroup

Groups related toggles so users can select one or more options together. Use it for compact toolbars and view preferences.

React

Ready

Figma

React examples

Default

import { ToggleGroup, ToggleGroupItem } from "@kela-systems/ui-components";

export default function ToggleGroupDefault() {
  return (
    <ToggleGroup defaultValue={["map"]} aria-label="View">
      <ToggleGroupItem value="map">Map</ToggleGroupItem>
      <ToggleGroupItem value="video">Video</ToggleGroupItem>
      <ToggleGroupItem value="split">Split</ToggleGroupItem>
    </ToggleGroup>
  );
}

Props

ToggleGroup

NameDefaultDescription
orientation
"horizontal" | "vertical"
"horizontal"
variant
"default" | "outline"
"outline"
size
"default" | "sm" | "lg"
"default"
spacing
number
2Gap between items in scale steps, so 2 is 8px. 0 joins them.
fill
boolean
falseStretches the items to fill the group's width.

It also takes the props of Base UI's toggle-group.

ToggleGroupItem

NameDefaultDescription
variant
"default" | "outline"
"outline"
size
"default" | "sm" | "lg"
"default"

It also takes the props of Base UI's toggle.

Read this page as Markdown

Search ARK

Find a page, a primitive or a component.