Button Group

Full Width Actions

A full-width phone action bar: equal shares through flex:1 1 0, the icon above the caption and room for the home indicator below.

  • buttongroup
  • mobile
  • full-width
  • actions

Preview

1440pxHost theme

Use it with AI

  1. 1. Copy the link.
  2. 2. Write to your agent in your own words and drop the link into the sentence.
  3. 3. The agent opens the link and installs the component from the registry.

put this in the header: https://vibeui.ru/c/buttongroup-053?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-053" (Full Width 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-053.json

Registry item: https://vibeui.ru/r/buttongroup-053.json
Installs to: components/vibeui/buttongroup-053.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 full-width phone action bar: equal shares through flex:1 1 0, the icon above the caption and room for the home indicator below.

A full-width action bar: equal shares, icon above caption, a safe bottom inset. Zero dependencies, one file, a server component.

## 3. How to use it
import { Buttongroup053 } from "@/components/vibeui/buttongroup-053"

<Buttongroup053
  actions={[{ id: "call", label: "Call" }, { id: "chat", label: "Message" }]}
  label="Contact actions"
/>

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-053-* palette — do not swap it for your theme tokens
- flex:1 1 0 with a zero basis: with auto a long caption claims more than its share
- min-width:0 on the buttons — without it a flex item never shrinks below its content and the bar overflows
- truncating the caption instead of wrapping: wrapping makes one button taller than the rest
- env(safe-area-inset-bottom) in the bottom padding, or the bar hides under the home indicator
- the 3.25rem height — a comfortable touch target for a bottom bar

## 6. You may change
- the actions and their icons through actions
- the accessible group name through label
- the focus ring colour through accent
- the bar width through your own max-width on the root

## 7. Rules
- Captions are truncated with an ellipsis: a long translation disappears quietly, check the narrowest screen.
- Five buttons in a row is already too many: the captions become unreadable on a phone.
- The bar is not sticky by default: add position:sticky on the page side.
- 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-053.json
https://vibeui.ru/r/buttongroup-053.json

Компонент самодостаточен: один файл, без зависимостей, собственная палитра в переменных --vibeui-buttongroup-053-*. Серверный: хуков нет. Кнопки делят ширину поровну через flex:1 1 0 — именно нулевая основа, иначе «Поделиться» заберёт себе больше «Чат»; min-width:0 разрешает кнопке сжиматься меньше содержимого. Значок стоит над подписью, потому что в строку они на девяноста пикселях не помещаются; подпись обрезается ellipsis, а не переносится, чтобы высота панели была одинаковой у всех кнопок. Нижний отступ равен env(safe-area-inset-bottom): панель обычно липнет к нижнему краю, где проходит системный жест. Разделители рисует button + button.

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 Buttongroup053Action = {
  id: string
  label: string
}

export type Buttongroup053Props = Omit<
  ComponentPropsWithoutRef<"div">,
  "children"
> & {
  actions?: Buttongroup053Action[]
  label?: string
  accent?: string
}

// Идея компонента: панель действий во всю ширину экрана телефона. Кнопки
// делят ширину поровну через flex:1 1 0 — именно нулевая основа, иначе
// «Поделиться» заберёт себе больше «Чат». Значок стоит над подписью, потому
// что в строку они на 90 пикселях не помещаются; подпись обрезается
// ellipsis, а не переносится, чтобы высота панели была одинаковой у всех
// кнопок. Высота цели 3.25rem плюс env(safe-area-inset-bottom): панель
// обычно липнет к нижнему краю, где проходит системный жест.
const STYLES = `
:where([data-vibeui-block="buttongroup-053"]){
--vibeui-buttongroup-053-surface:oklch(1 0 0);
--vibeui-buttongroup-053-fg:oklch(0.25 0.016 265);
--vibeui-buttongroup-053-muted:oklch(0.55 0.014 265);
--vibeui-buttongroup-053-border:oklch(0.9 0.006 265);
--vibeui-buttongroup-053-accent:oklch(0.5 0.16 265);
--vibeui-buttongroup-053-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-vibeui-block="buttongroup-053"]{
box-sizing:border-box;display:flex;width:100%;max-width:26rem;
padding-bottom:env(safe-area-inset-bottom,0px);
border-top:1px solid var(--vibeui-buttongroup-053-border);
background:var(--vibeui-buttongroup-053-surface);
font-family:var(--vibeui-buttongroup-053-font);
}
[data-vibeui-block="buttongroup-053"] *{box-sizing:border-box}
[data-vibeui-block="buttongroup-053"] button{
appearance:none;cursor:pointer;font:inherit;
flex:1 1 0;min-width:0;
display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:0.25rem;
height:3.25rem;padding:0 0.25rem;
border:0;background:transparent;
color:var(--vibeui-buttongroup-053-muted);
font-size:0.6875rem;font-weight:650;line-height:1.1;
transition:color .16s ease,background-color .16s ease;
}
[data-vibeui-block="buttongroup-053"] button + button{
border-inline-start:1px solid var(--vibeui-buttongroup-053-border);
}
[data-vibeui-block="buttongroup-053"] svg{
width:1.25rem;height:1.25rem;flex:none;
stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;
}
/* Подпись обрезается, а не переносится: высота панели остаётся одной. */
[data-vibeui-block="buttongroup-053"] [data-part="text"]{
max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
[data-vibeui-block="buttongroup-053"] button:hover{
color:var(--vibeui-buttongroup-053-fg);background:oklch(0.975 0.004 265);
}
[data-vibeui-block="buttongroup-053"] button:active{background:oklch(0.95 0.006 265)}
[data-vibeui-block="buttongroup-053"] button:focus-visible{
outline:2px solid var(--vibeui-buttongroup-053-accent);outline-offset:-3px;
color:var(--vibeui-buttongroup-053-accent);
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="buttongroup-053"] *{animation:none!important;transition:none!important}}
`

const ICONS: Record<string, string> = {
  call: "M6 3h4l2 5-3 2a12 12 0 0 0 5 5l2-3 5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 4 5a2 2 0 0 1 2-2",
  chat: "M4 5h16v10H8l-4 4z",
  route:
    "M12 21s7-6.2 7-11a7 7 0 1 0-14 0c0 4.8 7 11 7 11M12 8a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5",
  share: "M12 15V4M8 8l4-4 4 4M5 15v4a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-4",
}

const DEFAULT_ACTIONS: Buttongroup053Action[] = [
  { id: "call", label: "Позвонить" },
  { id: "chat", label: "Написать" },
  { id: "route", label: "Маршрут" },
  { id: "share", label: "Поделиться" },
]

/**
 * Панель действий во всю ширину: равные доли, значок над подписью, safe-area.
 * Один файл, ноль зависимостей, серверный компонент.
 */
export function Buttongroup053({
  actions = DEFAULT_ACTIONS,
  label = "Действия с контактом",
  accent,
  className,
  style,
  ...props
}: Buttongroup053Props) {
  const palette = {
    ...(accent ? { "--vibeui-buttongroup-053-accent": accent } : null),
    ...style,
  } as CSSProperties

  return (
    <>
      <style href="vibeui-buttongroup-053" precedence="medium">
        {STYLES}
      </style>
      <div
        {...props}
        data-vibeui-block="buttongroup-053"
        className={className}
        style={palette}
        role="group"
        aria-label={label}
      >
        {actions.map((action) => (
          <button key={action.id} type="button">
            <svg viewBox="0 0 24 24" aria-hidden="true">
              <path d={ICONS[action.id] ?? ICONS.chat} />
            </svg>
            <span data-part="text">{action.label}</span>
          </button>
        ))}
      </div>
    </>
  )
}