Buttons
Form Footer Actions
The whole end of a form: in a narrow column both buttons run full width one under the other, and from 26rem of its own width they line up in a row.
- button
- form
- mobile
- container-query
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/button-029?lang=en
We answer within one business day
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-029" (Form Footer 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/button-029.json
Registry item: https://vibeui.ru/r/button-029.json
Installs to: components/vibeui/button-029.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
The whole end of a form: in a narrow column both buttons run full width one under the other, and from 26rem of its own width they line up in a row.
Not one button but the end of a form. In a narrow column the primary action runs full width with the secondary one below it, also full width — a thumb lands anywhere on the row. From 26rem of its own width the pair becomes a row, the secondary button moves left and shrinks to its content, and the fine print underneath aligns right.
## 3. How to use it
import { Button029 } from "@/components/vibeui/button-029"
<Button029
label="Send request"
secondaryLabel="Save draft"
note="We answer within one business day"
/>
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 stacked order: the primary action on top, the secondary below — on a phone the top one gets pressed first
- the swap through order in the row: visually the secondary button moves left while the primary stays first in the markup
- container-type on the root and the @container rules on the inner shell: a container query never applies to its own container
- the 2.75rem button height: that is the lower bound of a comfortable thumb target
- type="submit" on the primary and type="button" on the secondary — otherwise the second button silently submits the form
- the fine print as its own paragraph below the buttons rather than a caption inside one
## 6. You may change
- the label and secondaryLabel captions
- the fine print through the note prop, an empty string removes it entirely
- the accent colour through the accent prop
- the block width through className, the built-in maximum is 32rem
- the breakpoint of the reflow — it is a single @container rule in the styles
## 7. Rules
- The block is meant to live inside a <form>: the primary button submits it, and the handler belongs on the form.
- Do not swap @container for @media: in a narrow desktop column the layout has to stay vertical.
- Do not drop the secondary button to save space — a plain button would then be the simpler choice than this block.
- 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-029.jsonhttps://vibeui.ru/r/button-029.jsonКомпонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-button-029-*. Серверный: хуков нет. Раскладка считается от собственной ширины блока через container-type:inline-size, а правила @container висят на внутреннем [data-part="shell"] — контейнерный запрос не действует на сам контейнер. Основная кнопка объявлена type="submit", вторая — type="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 Button029Props = Omit<
ComponentPropsWithoutRef<"div">,
"children"
> & {
label?: string
secondaryLabel?: string
/** Мелкая строка под кнопками: согласие, условия, срок ответа. */
note?: string
accent?: string
}
// Идея компонента: концовка формы целиком, а не одна кнопка. На узкой
// колонке основное действие растянуто во всю ширину, отмена стоит под ним
// и тоже во всю ширину — большой палец попадает в любую точку строки.
// От 26rem собственной ширины пара перестраивается в ряд, отмена уходит
// влево и ужимается по содержимому. Считается ширина самого блока через
// container query, поэтому в узкой колонке десктопа раскладка тоже мобильная.
const STYLES = `
:where([data-vibeui-block="button-029"]){
--vibeui-button-029-bg:oklch(1 0 0);
--vibeui-button-029-fg:oklch(0.26 0.016 265);
--vibeui-button-029-muted:oklch(0.55 0.014 265);
--vibeui-button-029-border:oklch(0.9 0.006 265);
--vibeui-button-029-accent:oklch(0.55 0.17 265);
--vibeui-button-029-accent-fg:oklch(0.99 0.01 265);
--vibeui-button-029-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
container-type:inline-size;
}
[data-vibeui-block="button-029"]{
width:100%;max-width:32rem;box-sizing:border-box;
padding:1rem;border:1px solid var(--vibeui-button-029-border);border-radius:0.875rem;
background:var(--vibeui-button-029-bg);color:var(--vibeui-button-029-fg);
font-family:var(--vibeui-button-029-font);
}
[data-vibeui-block="button-029"] [data-part="shell"]{
display:flex;flex-direction:column;gap:0.5rem;
}
[data-vibeui-block="button-029"] button{
appearance:none;cursor:pointer;
display:inline-flex;align-items:center;justify-content:center;
width:100%;height:2.75rem;padding:0 1.25rem;box-sizing:border-box;
border:1px solid transparent;border-radius:0.625rem;
font:inherit;font-size:0.9375rem;font-weight:650;line-height:1;
transition:filter .16s ease,border-color .16s ease,background-color .16s ease;
}
[data-vibeui-block="button-029"] [data-part="primary"]{
background:var(--vibeui-button-029-accent);color:var(--vibeui-button-029-accent-fg);
}
[data-vibeui-block="button-029"] [data-part="primary"]:hover{filter:brightness(0.96)}
[data-vibeui-block="button-029"] [data-part="secondary"]{
background:transparent;color:var(--vibeui-button-029-muted);border-color:var(--vibeui-button-029-border);
}
[data-vibeui-block="button-029"] [data-part="secondary"]:hover{color:var(--vibeui-button-029-fg);border-color:var(--vibeui-button-029-muted)}
[data-vibeui-block="button-029"] button:focus-visible{outline:2px solid var(--vibeui-button-029-accent);outline-offset:2px}
[data-vibeui-block="button-029"] [data-part="note"]{
margin:0.75rem 0 0;text-align:center;
color:var(--vibeui-button-029-muted);font-size:0.75rem;line-height:1.4;
}
/* Правила висят на внутренней раскладке: контейнерный запрос не действует
на сам контейнер, поэтому корню его давать бессмысленно. */
@container (min-width: 26rem){
[data-vibeui-block="button-029"] [data-part="shell"]{flex-direction:row;justify-content:flex-end}
[data-vibeui-block="button-029"] button{width:auto}
[data-vibeui-block="button-029"] [data-part="primary"]{order:2;min-width:11rem}
[data-vibeui-block="button-029"] [data-part="secondary"]{order:1}
[data-vibeui-block="button-029"] [data-part="note"]{text-align:right}
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="button-029"] *{animation:none!important;transition:none!important}}
`
/**
* Концовка формы: основная кнопка во всю ширину и отмена под ней.
* Один файл, ноль зависимостей, собственная палитра.
*/
export function Button029({
label = "Отправить заявку",
secondaryLabel = "Сохранить черновик",
note = "Отвечаем в течение одного рабочего дня",
accent,
className,
style,
...props
}: Button029Props) {
const palette = {
...(accent ? { "--vibeui-button-029-accent": accent } : null),
...style,
} as CSSProperties
return (
<>
<style href="vibeui-button-029" precedence="medium">
{STYLES}
</style>
<div
{...props}
data-vibeui-block="button-029"
className={className}
style={palette}
>
<div data-part="shell">
<button type="submit" data-part="primary">
{label}
</button>
{secondaryLabel ? (
<button type="button" data-part="secondary">
{secondaryLabel}
</button>
) : null}
</div>
{note ? <p data-part="note">{note}</p> : null}
</div>
</>
)
}