Toggle Group
Align Group
A single-select group of toggle buttons: the alignment applies to the sample at once and focus moves inside the group with a roving tabindex.
What you can change
- the group name through label
- the initial value through defaultValue
- the sample copy through text
A link for your AI agent: preview, code and instructions.
Preview
Use it with AI
- 1. Copy the link.
- 2. Write to your agent in your own words and drop the link into the sentence.
- 3. The agent opens the link and installs the component from the registry.
put this on the home page as the hero:
https://vibeui.ru/c/togglegroup-001?lang=en&theme=dark
Not sure where to paste it? Step-by-step guide
Show the full instructions
What the link says, spelled out. Use it when your agent cannot open links — paste this text instead.
Loading…
For developers
The install command lives in the “Component source” block below — a signed link that stays valid for 24 hours.
Technical notes
One file, zero dependencies, the --vibeui-togglegroup-001-* palette. Client component: useState and a useRef on the list of buttons. The difference from the buttongroup category is fundamental: there the buttons are chained as actions ("Save", "Cancel"), here every button declares a state through aria-pressed and exactly one of them is pressed. The container is marked role="group" with an aria-label. Focus moves by a roving tabindex: the pressed button has tabIndex=0 and the rest −1, the arrows move focus with wrap-around, Home and End go to the edges; selection is made by Enter and Space, so walking with the arrows changes nothing by accident.
Tags
- togglegroup
- aria-pressed
- align
- roving-tabindex
Component source
The same file your agent installs. Here in case you would rather copy it by hand.
Loading…