Zephora UI

Form

ToggleGroup

Segmented control with single (radio-style) or multiple (pressed-button) selection, roving tab stop and arrow-key navigation.

Import

import { ToggleGroup, ToggleGroupItem } from "@zephora/react";

Examples

Single selection

Multiple selection

In multiple mode each item is an independent aria-pressed toggle.

Active: bold

Sizes and full width

API

ToggleGroup props

PropTypeDefaultDescription
type"single" | "multiple""single"Selection mode.
valuestring | string[]Controlled value — string for single, string[] for multiple.
defaultValuestring | string[]Initial value in uncontrolled mode.
onValueChange(value: string | string[]) => voidCalled with the new value (string for single, string[] for multiple).
disabledbooleanfalseDisables the whole group.
size"sm" | "md" | "lg""md"Item scale.
fullWidthbooleanfalseStretches the group (and items) to the container width.
unstyledbooleanfalseHeadless mode — drops Zephora classes so your own CSS can style it.
…restHTMLAttributes<HTMLDivElement>Forwarded to the group element; provide aria-label or aria-labelledby.

ToggleGroupItem props

PropTypeDefaultDescription
value *stringValue this item contributes to the group.
disabledbooleanfalseDisables just this item.
…restOmit<ButtonHTMLAttributes<HTMLButtonElement>, "value">All native button props are forwarded.

Keyboard

KeyAction
Arrow Right / Arrow DownFocuses the next item (wraps).
Arrow Left / Arrow UpFocuses the previous item (wraps).
Home / EndFocuses the first / last item.
Enter / SpaceToggles the focused item.