Skip to main content
  1. Docs
  2. Components
  3. Actions

Toggle group

A row of toggles: one view among a few, or a set of tools that are each on or off.

Import
@qeetrix/react
Status
StableSince 0.0.2
Renders
<div role="group">Server-rendered
Tested
WCAG 2.2 AAaxe on every pull request

01

Playground

Every prop, live, and the code it takes.

Content
Variant
Size
Orientation
period.tsx
import { Toggle, ToggleGroup } from "@qeetrix/react";

<ToggleGroup defaultValue={["30d"]} aria-label="Period">
  <Toggle value="7d">7 days</Toggle>
  <Toggle value="30d">30 days</Toggle>
  <Toggle value="90d">90 days</Toggle>
</ToggleGroup>

02

One view among a few

segmented, the default: one joined control, one choice. Arrow keys move between them.

03

Controlled

value and onValueChange: keep one pressed, and let the page follow it.

Sign-ins over the last 30 days.

04

Several at once

separate and multiple: a set of tools, each on or off.

05

In a toolbar

Tools beside a choice, split by a rule.

06

Vertical

orientation="vertical": stacked, and the up and down arrows move.

Next — Toggle groupUsage