Button Group
Editor Toolbar
A toolbar with roving tabindex: Tab enters once and from there arrows, Home and End walk the icons — exactly as the toolbar pattern requires.
What you can change
- the set of instruments through tools
- the accessible toolbar name through label
- visible text captions through showLabels
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/buttongroup-004?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
The component is self-contained: one file, no dependencies, its own palette in the --vibeui-buttongroup-004-* variables. It is a client component: useState holds the index of the active button, useRef holds the panel, and the onKeyDown handler parses ArrowLeft/ArrowRight with wrap-around and Home/End. The active button gets tabIndex=0 and the rest -1 — that is the roving tabindex from the WAI-ARIA toolbar pattern. onFocus syncs the index when focus arrived by mouse. The icons are inline SVGs with stroke="currentColor", and the separator between the third and the fourth button is drawn by a node of its own. The captions are turned on by the showLabels prop: aria-label is then removed so that the name is not doubled.
Tags
- buttongroup
- toolbar
- keyboard
- icons
Component source
The same file your agent installs. Here in case you would rather copy it by hand.
Loading…