ZUI

Search documentation

Find a page or a heading.

Language Toggle Group

Every language shown inline as a single-select toggle group for a small fixed set, which never deselects so a language is always chosen.

tsx

Installation

bash

Usage

tsx
tsx

The consumer composes one ToggleGroupItem per option, usually mapping Language Combobox's useLanguageOptions. Use it for a small, fixed set of two to four languages; for a longer or searchable list, use Language Combobox instead.

API reference

LanguageToggleGroup

Renders shadcn's ToggleGroup and takes every prop it takes except value, defaultValue, onValueChange and multiple, plus:

Binds Base UI's array value to the lone language and ignores a deselect, so a language is always chosen. It defaults variant to outline and keeps the toggle group's default spacing. It sets data-slot="language-toggle-group".