Buttons

Speed Dial FAB

A round primary action button with quick actions that stagger out from under it, labels and all; Esc closes the fan.

  • button
  • fab
  • speed-dial
  • 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/button-037?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 "button-037" (Speed Dial FAB) 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/button-037.json

Registry item: https://vibeui.ru/r/button-037.json
Installs to: components/vibeui/button-037.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 round primary action button with quick actions that stagger out from under it, labels and all; Esc closes the fan.

A round action button with a fan of quick commands. On click the plus turns into a cross and labelled pills stagger out above the button, each with its own transition-delay derived from its index. Esc closes the fan, and the state is announced through aria-expanded. Zero dependencies, one file.

## 3. How to use it
import { Button037 } from "@/components/vibeui/button-037"

<Button037
  label="Quick actions"
  actions={[
    { id: "task", label: "New task" },
    { id: "note", label: "Note" },
  ]}
  onSelect={run}
/>

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 label on every quick action: a row of anonymous circles is unreadable
- the stagger built from transition-delay by index — it turns an appearance into an unfolding rather than a jump
- the plus turning into a cross: it shows that a second click closes the fan
- aria-expanded on the main button and hidden on the list: closed items must not catch Tab
- the Esc shortcut — an open fan covers the interface and needs a one-key way out
- the prefers-reduced-motion rule: the fan opens instantly, but it still opens

## 6. You may change
- the main button's name through the label prop, which becomes its aria-label
- the set of quick actions through the actions prop
- the initial expansion through the defaultOpen prop
- the accent colour through the accent prop
- the onSelect handler: it receives the id of the chosen action

## 7. Rules
- Do not put more than five entries into actions: the fan stops reading and turns into a menu that needs its own layer.
- Do not drop the labels for compactness — an unnamed icon is identified neither by eye nor by screen reader.
- The component does not draw an overlay menu: it positions itself relative to itself, the shared layer is your app's job.
- 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/button-037.json
https://vibeui.ru/r/button-037.json

Компонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-button-037-*. Клиентский компонент: раскрытие — внутреннее состояние, наружу уходит только выбранный id через onSelect. Лесенка сделана на transition-delay, который считается из индекса элемента через переменную --vibeui-button-037-index, — никаких таймеров в JS. Список абсолютно позиционирован над кнопкой и скрыт атрибутом hidden, поэтому закрытые пункты не попадают в порядок обхода Tab.

Component source

The same file your agent installs. Here in case you would rather copy it by hand.

"use client"

import { useState } from "react"
import type {
  ComponentPropsWithoutRef,
  CSSProperties,
  KeyboardEvent,
} from "react"

export type Button037Action = { id: string; label: string }

export type Button037Props = Omit<
  ComponentPropsWithoutRef<"div">,
  "children" | "onSelect"
> & {
  label?: string
  /** Быстрые действия, которые выезжают из-под кнопки. */
  actions?: Button037Action[]
  defaultOpen?: boolean
  onSelect?: (id: string) => void
  accent?: string
}

// Идея компонента: круглая кнопка главного действия, из которой веером
// выезжают быстрые действия. В отличие от одиночного FAB здесь у каждого
// действия своя подпись слева, а выезд идёт лесенкой: у i-го элемента
// свой transition-delay, поэтому стопка читается как раскрытие, а не рывок.
const STYLES = `
:where([data-vibeui-block="button-037"]){
--vibeui-button-037-accent:oklch(0.56 0.2 25);
--vibeui-button-037-fg:oklch(0.99 0.01 25);
--vibeui-button-037-surface:oklch(1 0 0);
--vibeui-button-037-ink:oklch(0.26 0.016 265);
--vibeui-button-037-border:oklch(0.9 0.006 265);
--vibeui-button-037-size:3.25rem;
--vibeui-button-037-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-vibeui-block="button-037"]{
position:relative;display:inline-flex;
font-family:var(--vibeui-button-037-font);
}
[data-vibeui-block="button-037"] [data-part="main"]{
appearance:none;border:0;cursor:pointer;
display:inline-flex;align-items:center;justify-content:center;
width:var(--vibeui-button-037-size);height:var(--vibeui-button-037-size);
border-radius:50%;background:var(--vibeui-button-037-accent);color:var(--vibeui-button-037-fg);
box-shadow:0 14px 28px -14px color-mix(in oklab,var(--vibeui-button-037-accent) 75%,transparent);
transition:filter .16s ease;
}
[data-vibeui-block="button-037"] [data-part="main"]:hover{filter:brightness(1.06)}
[data-vibeui-block="button-037"] [data-part="main"]:focus-visible{outline:2px solid var(--vibeui-button-037-accent);outline-offset:3px}
[data-vibeui-block="button-037"] [data-part="cross"]{position:relative;width:1.125rem;height:1.125rem;transition:transform .22s cubic-bezier(0.16,1,0.3,1)}
[data-vibeui-block="button-037"] [data-part="cross"]::before,
[data-vibeui-block="button-037"] [data-part="cross"]::after{
content:"";position:absolute;left:50%;top:50%;background:currentColor;border-radius:2px;
}
[data-vibeui-block="button-037"] [data-part="cross"]::before{width:1.125rem;height:2px;margin:-1px 0 0 -0.5625rem}
[data-vibeui-block="button-037"] [data-part="cross"]::after{width:2px;height:1.125rem;margin:-0.5625rem 0 0 -1px}
[data-vibeui-block="button-037"][data-open="true"] [data-part="cross"]{transform:rotate(135deg)}
[data-vibeui-block="button-037"] [data-part="dial"]{
position:absolute;left:50%;bottom:calc(var(--vibeui-button-037-size) + 0.625rem);
transform:translateX(-50%);
display:flex;flex-direction:column-reverse;align-items:center;gap:0.5rem;
margin:0;padding:0;list-style:none;
}
[data-vibeui-block="button-037"] [data-part="dial"][hidden]{display:none}
[data-vibeui-block="button-037"] [data-part="item"]{
display:flex;align-items:center;gap:0.5rem;
opacity:0;transform:translateY(0.75rem) scale(.9);
transition:opacity .18s ease,transform .22s cubic-bezier(0.16,1,0.3,1);
transition-delay:calc(var(--vibeui-button-037-index) * 45ms);
}
[data-vibeui-block="button-037"][data-open="true"] [data-part="item"]{opacity:1;transform:none}
[data-vibeui-block="button-037"] [data-part="action"]{
appearance:none;cursor:pointer;white-space:nowrap;
display:inline-flex;align-items:center;gap:0.5rem;
height:2.25rem;padding:0 0.875rem;border-radius:9999px;
border:1px solid var(--vibeui-button-037-border);
background:var(--vibeui-button-037-surface);color:var(--vibeui-button-037-ink);
font:inherit;font-size:0.8125rem;font-weight:600;line-height:1;
box-shadow:0 8px 18px -14px oklch(0 0 0 / 55%);
transition:border-color .16s ease,color .16s ease;
}
[data-vibeui-block="button-037"] [data-part="action"]:hover{border-color:var(--vibeui-button-037-accent);color:var(--vibeui-button-037-accent)}
[data-vibeui-block="button-037"] [data-part="action"]:focus-visible{outline:2px solid var(--vibeui-button-037-accent);outline-offset:2px}
[data-vibeui-block="button-037"] [data-part="bullet"]{
flex:none;width:0.4375rem;height:0.4375rem;border-radius:50%;
background:var(--vibeui-button-037-accent);
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="button-037"] *{animation:none!important;transition:none!important}}
`

/**
 * Круглая кнопка главного действия с веером быстрых действий.
 * Один файл, ноль зависимостей, собственная палитра.
 */
export function Button037({
  label = "Быстрые действия",
  actions = [
    { id: "task", label: "Новая задача" },
    { id: "note", label: "Заметка" },
    { id: "upload", label: "Загрузить файл" },
  ],
  defaultOpen = false,
  onSelect,
  accent,
  className,
  style,
  ...props
}: Button037Props) {
  const [open, setOpen] = useState(defaultOpen)

  const palette = {
    ...(accent ? { "--vibeui-button-037-accent": accent } : null),
    ...style,
  } as CSSProperties

  // Esc закрывает веер с любого элемента внутри: раскрытая стопка
  // перекрывает интерфейс, и выход из неё должен быть на одной клавише.
  const escape = (event: KeyboardEvent<HTMLDivElement>) => {
    if (event.key === "Escape" && open) {
      event.stopPropagation()
      setOpen(false)
    }
  }

  return (
    <>
      <style href="vibeui-button-037" precedence="medium">
        {STYLES}
      </style>
      <div
        {...props}
        data-vibeui-block="button-037"
        data-open={String(open)}
        className={className}
        style={palette}
        onKeyDown={escape}
      >
        <ul data-part="dial" hidden={!open}>
          {actions.map((action, index) => (
            <li
              key={action.id}
              data-part="item"
              style={
                {
                  "--vibeui-button-037-index": String(index),
                } as CSSProperties
              }
            >
              <button
                type="button"
                data-part="action"
                onClick={() => {
                  setOpen(false)
                  onSelect?.(action.id)
                }}
              >
                <span data-part="bullet" aria-hidden="true" />
                {action.label}
              </button>
            </li>
          ))}
        </ul>
        <button
          type="button"
          data-part="main"
          aria-label={label}
          aria-expanded={open}
          onClick={() => setOpen((value) => !value)}
        >
          <span data-part="cross" aria-hidden="true" />
        </button>
      </div>
    </>
  )
}