Button Group
Vertical Actions
A vertical group for a narrow column: full-width buttons, borders collapsed vertically, caption on the left and hint on the right.
- buttongroup
- vertical
- sidebar
- actions
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 in the header: https://vibeui.ru/c/buttongroup-007?lang=en
Show the full instructions
What the link says, spelled out. Use it when your agent cannot open links — paste this text instead.
# Install and place "buttongroup-007" (Vertical Actions) from VibeUI
## 1. Install first — do not skip, do not recreate
Run this exact command before writing any code:
npx shadcn@latest add https://vibeui.ru/r/buttongroup-007.json
Registry item: https://vibeui.ru/r/buttongroup-007.json
Installs to: components/vibeui/buttongroup-007.tsx (the exact path follows this project's components.json aliases).
npm dependencies: none.
Registry dependencies: none.
Install it from the registry. Do not recreate it from the description,
do not substitute a similar component from another library, and do not
rewrite it to match the project's existing style.
## 2. What it is
A vertical group for a narrow column: full-width buttons, borders collapsed vertically, caption on the left and hint on the right.
A list of actions folded into a column for a narrow rail: one cluster instead of a button row torn across two lines. Zero dependencies, one file, a server component.
## 3. How to use it
import { Buttongroup007 } from "@/components/vibeui/buttongroup-007"
<Buttongroup007
actions={[{ label: "Rename", hint: "F2" }, { label: "Move", hint: "⌘M" }]}
label="File operations"
width={16}
/>
Read the installed file for the full prop list.
## 4. Where to place it
This is a small inline component. Put it exactly where the user asked,
inside the existing markup. Do not create a new page, section or
wrapper for it. If a similar control already sits in that spot,
replace it instead of adding a second one.
Placement: ___
(The user fills this line in. If it is still blank, ask where to put it
instead of guessing.)
## 5. Keep exactly as installed
- the local --vibeui-buttongroup-007-* palette — do not swap it for your theme tokens
- the vertically collapsed borders: two adjacent borders make a two-pixel line
- the z-index on focus — the next button covers the bottom border, so the ring would show only on top
- rounded corners only on the first and last button, so the column reads as one part
- the left-aligned caption: centred, the eye loses the column of names
- the buttons' own light surface — without it the dark text disappears on a dark background
## 6. You may change
- the actions and their hints through actions
- the accessible group name through label
- the column width through width
- the focus ring colour through accent
## 7. Rules
- The right-hand hint is not a shortcut by default: a counter or a file size fits there just as well.
- Captions are only visually single-line: long text grows the row in height.
- The buttons carry no onClick: wire your handlers at install time.
- Do not lift the CSS variables into globals.css: the component has to stay a single file.
## 8. Verify
- it renders with no console errors;
- it looks like the preview on the VibeUI page you copied this from;
- if it does not, you changed something listed in section 5 — put it back.For developers
npx shadcn@latest add https://vibeui.ru/r/buttongroup-007.jsonhttps://vibeui.ru/r/buttongroup-007.jsonКомпонент самодостаточен: один файл, без зависимостей, собственная палитра в переменных --vibeui-buttongroup-007-*. Серверный: хуков нет. Ширина считается от собственной: width:100% с max-width из --vibeui-buttongroup-007-width, значение приходит пропсом width в rem. Границы схлопнуты по вертикали через margin-block-start:-1px, скругления логическими свойствами достаются только первой и последней кнопке. Кнопка с фокусом поднимается z-index:2, потому что соседняя перекрывает её нижнюю границу. Подпись занимает всё свободное место (flex:1 1 auto; min-width:0), подсказка прижата к правому краю и набрана табличными цифрами.
Component source
The same file your agent installs. Here in case you would rather copy it by hand.
import type { ComponentPropsWithoutRef, CSSProperties } from "react"
export type Buttongroup007Action = {
label: string
hint?: string
}
export type Buttongroup007Props = Omit<
ComponentPropsWithoutRef<"div">,
"children"
> & {
actions?: Buttongroup007Action[]
label?: string
width?: number
accent?: string
}
// Идея компонента: в узкой колонке горизонтальная группа рвётся на две
// строки и перестаёт читаться как одна деталь. Здесь она сложена в столбец:
// кнопки во всю ширину, границы схлопнуты по вертикали, скругления остались
// только у верхней и нижней. Подпись прижата к левому краю, подсказка — к
// правому: так глаз идёт по одной колонке названий, а не по центру.
const STYLES = `
:where([data-vibeui-block="buttongroup-007"]){
--vibeui-buttongroup-007-surface:oklch(1 0 0);
--vibeui-buttongroup-007-fg:oklch(0.26 0.016 265);
--vibeui-buttongroup-007-muted:oklch(0.58 0.014 265);
--vibeui-buttongroup-007-border:oklch(0.89 0.008 265);
--vibeui-buttongroup-007-hover:oklch(0.965 0.004 265);
--vibeui-buttongroup-007-accent:oklch(0.55 0.17 265);
--vibeui-buttongroup-007-radius:0.75rem;
--vibeui-buttongroup-007-width:16rem;
--vibeui-buttongroup-007-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-vibeui-block="buttongroup-007"]{
box-sizing:border-box;display:flex;flex-direction:column;isolation:isolate;
width:100%;max-width:var(--vibeui-buttongroup-007-width);
font-family:var(--vibeui-buttongroup-007-font);
}
[data-vibeui-block="buttongroup-007"] *{box-sizing:border-box}
[data-vibeui-block="buttongroup-007"] button{
appearance:none;cursor:pointer;font:inherit;
position:relative;z-index:0;
display:flex;align-items:center;gap:0.625rem;
width:100%;min-height:2.375rem;padding:0 0.75rem;margin-block-start:-1px;
border:1px solid var(--vibeui-buttongroup-007-border);
background:var(--vibeui-buttongroup-007-surface);
color:var(--vibeui-buttongroup-007-fg);
font-size:0.8125rem;font-weight:600;line-height:1.3;text-align:start;
transition:background-color .16s ease;
}
[data-vibeui-block="buttongroup-007"] button:first-child{
margin-block-start:0;
border-start-start-radius:var(--vibeui-buttongroup-007-radius);
border-start-end-radius:var(--vibeui-buttongroup-007-radius);
}
[data-vibeui-block="buttongroup-007"] button:last-child{
border-end-start-radius:var(--vibeui-buttongroup-007-radius);
border-end-end-radius:var(--vibeui-buttongroup-007-radius);
}
[data-vibeui-block="buttongroup-007"] button:hover{z-index:1;background:var(--vibeui-buttongroup-007-hover)}
/* Соседняя кнопка перекрывает нижнюю границу текущей, поэтому обводке
фокуса нужен свой слой — иначе она видна только сверху. */
[data-vibeui-block="buttongroup-007"] button:focus-visible{
z-index:2;
outline:2px solid var(--vibeui-buttongroup-007-accent);outline-offset:1px;
}
[data-vibeui-block="buttongroup-007"] [data-part="dot"]{
width:0.375rem;height:0.375rem;flex:none;border-radius:9999px;
background:var(--vibeui-buttongroup-007-accent);opacity:.35;
}
[data-vibeui-block="buttongroup-007"] button:hover [data-part="dot"]{opacity:1}
[data-vibeui-block="buttongroup-007"] [data-part="name"]{flex:1 1 auto;min-width:0}
[data-vibeui-block="buttongroup-007"] [data-part="hint"]{
flex:none;color:var(--vibeui-buttongroup-007-muted);
font-size:0.75rem;font-weight:500;font-variant-numeric:tabular-nums;
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="buttongroup-007"] *{animation:none!important;transition:none!important}}
`
const DEFAULT_ACTIONS: Buttongroup007Action[] = [
{ label: "Переименовать", hint: "F2" },
{ label: "Переместить", hint: "⌘M" },
{ label: "Скачать копию", hint: "2,4 МБ" },
{ label: "История версий", hint: "12" },
]
/**
* Вертикальная группа кнопок во всю ширину узкой колонки.
* Один файл, ноль зависимостей, собственная палитра.
*/
export function Buttongroup007({
actions = DEFAULT_ACTIONS,
label = "Операции с файлом",
width = 16,
accent,
className,
style,
...props
}: Buttongroup007Props) {
const palette = {
"--vibeui-buttongroup-007-width": `${width}rem`,
...(accent ? { "--vibeui-buttongroup-007-accent": accent } : null),
...style,
} as CSSProperties
return (
<>
<style href="vibeui-buttongroup-007" precedence="medium">
{STYLES}
</style>
<div
{...props}
data-vibeui-block="buttongroup-007"
role="group"
aria-label={label}
className={className}
style={palette}
>
{actions.map((action) => (
<button key={action.label} type="button">
<span data-part="dot" aria-hidden="true" />
<span data-part="name">{action.label}</span>
{action.hint ? <span data-part="hint">{action.hint}</span> : null}
</button>
))}
</div>
</>
)
}