TidalUI

Toggle group preview

Choose one or several compact modes with pressed buttons and roving keyboard focus.

pro · Essentials · primitive

When to use

Alternatives

Configure components.json and the @tidal-pro namespace before installing Pro components.

Installation

npx shadcn@latest add @tidal-pro/toggle-group

Import components/ui/tidal.css, components/ui/toggle-group.css. Wrap installed components in tidal-scope.

Preview

Toggle group component preview

Open interactive preview

Minimal example

import"./components/ui/tidal.css";
import"./components/ui/toggle-group.css";
import{TidalToggleGroup}from"./components/ui/toggle-group";
export default()=><div className="tidal-scope"><TidalToggleGroup label="View" items={[{ id: "list", value: "list", label: "List" }]} type="single" value="list" onValueChange={() => {}}/></div>;

API and props

TidalToggleGroup.items (required)
ReadonlyArray<TidalToggleGroupItem>

Required items value accepted by this exported component.

TidalToggleGroup.label (required)
string

Required label value accepted by this exported component.

TidalToggleGroup.onValueChange (required)
((value: string | null) => void) | ((value: string[]) => void)

Callback invoked when the value change interaction is proposed.

TidalToggleGroup.type (required)
"multiple" | "single"

Required type value accepted by this exported component.

TidalToggleGroup.value (required)
string | ReadonlyArray<string> | null

Required value value accepted by this exported component.

TidalToggleGroup.dir
"ltr" | "rtl" | undefined

Optional dir value accepted by this exported component.

TidalToggleGroup.disabled
boolean | undefined

Optional disabled value accepted by this exported component.

TidalToggleGroup.orientation
"horizontal" | "vertical" | undefined

Optional orientation value accepted by this exported component.

Complete usage

Full example, stylesheet imports, API and accessibility documentation

Gotchas