Navigation

Checkout Steps

Checkout steps you can go back to: a finished step shows the chosen value and a return link, while an upcoming one stays plain text instead of a disabled button.

  • stepper
  • checkout
  • navigation
  • links

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/stepper-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 "stepper-007" (Checkout Steps) 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/stepper-007.json

Registry item: https://vibeui.ru/r/stepper-007.json
Installs to: components/vibeui/stepper-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
Checkout steps you can go back to: a finished step shows the chosen value and a return link, while an upcoming one stays plain text instead of a disabled button.

Checkout steps with a summary of the choices and a return link to a finished step. Zero dependencies, one file, no client JS.

## 3. How to use it
import { Stepper007 } from "@/components/vibeui/stepper-007"

<Stepper007
  current={2}
  editLabel="Edit"
/>

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-stepper-007-* palette — do not swap it for your theme tokens
- the link's accessible name including the step title: four "Edit" links in a row are indistinguishable in a links list
- aria-current="step" on the current step: it is the only one being filled in right now
- upcoming steps as plain text rather than disabled buttons: a disabled button promises an action that does not exist
- the visible focus on the return link: going back must be reachable from the keyboard
- the component's own light surface: dark text disappears on the dark catalog card

## 6. You may change
- the steps, chosen values and targets through steps
- the active step number through current
- the return link caption through editLabel
- the list's accessible name through label

## 7. Rules
- The return link is drawn only for a finished step that has an href: without a target there is nowhere to go.
- Values are shown for finished steps only: the current one has nothing chosen yet.
- The component does not forbid going back after payment — that is business logic, not an indicator'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/stepper-007.json
https://vibeui.ru/r/stepper-007.json

Компонент самодостаточен: один файл, без зависимостей, палитра в переменных --vibeui-stepper-007-*. Серверный: хуков нет, возврат — обычные ссылки. Пройденный шаг печатает выбранное значение, поэтому список работает и как сводка заказа. У ссылки возврата доступное имя вида «Изменить: доставка»: в списке из четырёх ссылок одинаковое слово «Изменить» бесполезно. Будущие шаги намеренно не притворяются отключёнными кнопками — это текст с подписью «Впереди», который не ловит фокус и не обещает нажатия. Пункт — grid из трёх колонок, значок и правый блок закреплены за своими колонками, поэтому строка не разъезжается без значения.

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 Stepper007Step = {
  title: string
  /** Что уже выбрано на шаге: показывается только у пройденных. */
  value?: string
  href?: string
}

export type Stepper007Props = Omit<
  ComponentPropsWithoutRef<"nav">,
  "children"
> & {
  steps?: Stepper007Step[]
  /** Номер текущего шага, считая с нуля. */
  current?: number
  /** Подпись ссылки возврата к пройденному шагу. */
  editLabel?: string
  label?: string
  accent?: string
}

// Идея компонента: шаги оформления заказа, к которым можно вернуться.
// Пройденный шаг показывает выбранное значение и ссылку возврата — у неё
// доступное имя вида «Изменить: доставка», иначе в списке из четырёх ссылок
// все называются одинаково. Будущие шаги ссылками не притворяются: это
// обычный текст, а не отключённая кнопка, которую нельзя нажать.
const STYLES = `
:where([data-vibeui-block="stepper-007"]){
--vibeui-stepper-007-bg:oklch(1 0 0);
--vibeui-stepper-007-fg:oklch(0.24 0.016 265);
--vibeui-stepper-007-muted:oklch(0.56 0.014 265);
--vibeui-stepper-007-border:oklch(0.92 0.006 265);
--vibeui-stepper-007-accent:oklch(0.55 0.2 262);
--vibeui-stepper-007-accent-fg:oklch(1 0 0);
--vibeui-stepper-007-done:oklch(0.55 0.14 155);
--vibeui-stepper-007-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-vibeui-block="stepper-007"]{
width:100%;max-width:30rem;box-sizing:border-box;
font-family:var(--vibeui-stepper-007-font);color:var(--vibeui-stepper-007-fg);
}
[data-vibeui-block="stepper-007"] [data-part="shell"]{
background:var(--vibeui-stepper-007-bg);
border:1px solid var(--vibeui-stepper-007-border);border-radius:1rem;overflow:hidden;
}
[data-vibeui-block="stepper-007"] ol{margin:0;padding:0;list-style:none}
[data-vibeui-block="stepper-007"] li{
display:grid;grid-template-columns:1.5rem 1fr auto;align-items:center;
gap:0.125rem 0.75rem;padding:0.75rem 1rem;
}
[data-vibeui-block="stepper-007"] li + li{border-top:1px solid var(--vibeui-stepper-007-border)}
[data-vibeui-block="stepper-007"] li[data-state="current"]{
background:color-mix(in oklab,var(--vibeui-stepper-007-accent) 6%,transparent);
}
[data-vibeui-block="stepper-007"] [data-part="mark"]{
grid-column:1;grid-row:1 / span 2;align-self:start;
display:flex;align-items:center;justify-content:center;
width:1.5rem;height:1.5rem;border-radius:9999px;
border:2px solid var(--vibeui-stepper-007-border);
background:var(--vibeui-stepper-007-bg);color:var(--vibeui-stepper-007-muted);
font-size:0.6875rem;font-weight:700;line-height:1;
}
[data-vibeui-block="stepper-007"] li[data-state="done"] [data-part="mark"]{
background:var(--vibeui-stepper-007-done);border-color:var(--vibeui-stepper-007-done);
color:var(--vibeui-stepper-007-accent-fg);
}
[data-vibeui-block="stepper-007"] li[data-state="current"] [data-part="mark"]{
background:var(--vibeui-stepper-007-accent);border-color:var(--vibeui-stepper-007-accent);
color:var(--vibeui-stepper-007-accent-fg);
}
[data-vibeui-block="stepper-007"] [data-part="title"]{
grid-column:2;font-size:0.875rem;font-weight:600;line-height:1.3;
}
[data-vibeui-block="stepper-007"] li[data-state="todo"] [data-part="title"]{
font-weight:500;color:var(--vibeui-stepper-007-muted);
}
[data-vibeui-block="stepper-007"] [data-part="value"]{
grid-column:2;font-size:0.8125rem;line-height:1.4;color:var(--vibeui-stepper-007-muted);
}
[data-vibeui-block="stepper-007"] [data-part="state"]{
grid-column:3;grid-row:1 / span 2;
font-size:0.75rem;color:var(--vibeui-stepper-007-muted);white-space:nowrap;
}
[data-vibeui-block="stepper-007"] [data-part="edit"]{
grid-column:3;grid-row:1 / span 2;
display:inline-flex;align-items:center;gap:0.25rem;
padding:0.25rem 0.5rem;border-radius:0.5rem;
color:var(--vibeui-stepper-007-accent);font-size:0.8125rem;font-weight:600;
text-decoration:none;white-space:nowrap;
}
[data-vibeui-block="stepper-007"] [data-part="edit"]:hover{
background:color-mix(in oklab,var(--vibeui-stepper-007-accent) 10%,transparent);
text-decoration:underline;
}
[data-vibeui-block="stepper-007"] [data-part="edit"]:focus-visible{
outline:2px solid var(--vibeui-stepper-007-accent);outline-offset:2px;
}
[data-vibeui-block="stepper-007"] [data-part="now"]{
grid-column:3;grid-row:1 / span 2;
padding:0.125rem 0.5rem;border-radius:9999px;
background:var(--vibeui-stepper-007-accent);color:var(--vibeui-stepper-007-accent-fg);
font-size:0.6875rem;font-weight:650;white-space:nowrap;
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="stepper-007"] *{animation:none!important;transition:none!important}}
`

const DEFAULT_STEPS: Stepper007Step[] = [
  {
    title: "Контакты",
    value: "Мария Ким, +7 917 000-11-22",
    href: "#contacts",
  },
  {
    title: "Доставка",
    value: "Курьером завтра, 12:00–15:00",
    href: "#delivery",
  },
  { title: "Оплата", href: "#payment" },
  { title: "Подтверждение", href: "#confirm" },
]

/**
 * Шаги оформления заказа: к пройденным можно вернуться по ссылке.
 * Один файл, ноль зависимостей, собственная палитра.
 */
export function Stepper007({
  steps = DEFAULT_STEPS,
  current = 2,
  editLabel = "Изменить",
  label = "Оформление заказа",
  accent,
  className,
  style,
  ...props
}: Stepper007Props) {
  const palette = {
    ...(accent ? { "--vibeui-stepper-007-accent": accent } : null),
    ...style,
  } as CSSProperties

  return (
    <>
      <style href="vibeui-stepper-007" precedence="medium">
        {STYLES}
      </style>
      <nav
        {...props}
        data-vibeui-block="stepper-007"
        aria-label={label}
        className={className}
        style={palette}
      >
        <div data-part="shell">
          <ol>
            {steps.map((step, index) => {
              const state =
                index < current
                  ? "done"
                  : index === current
                    ? "current"
                    : "todo"

              return (
                <li
                  key={step.title}
                  data-state={state}
                  aria-current={state === "current" ? "step" : undefined}
                >
                  <span data-part="mark" aria-hidden="true">
                    {state === "done" ? "✓" : index + 1}
                  </span>
                  <span data-part="title">{step.title}</span>
                  {state === "done" && step.value ? (
                    <span data-part="value">{step.value}</span>
                  ) : null}
                  {state === "done" && step.href ? (
                    <a
                      data-part="edit"
                      href={step.href}
                      aria-label={`${editLabel}: ${step.title.toLowerCase()}`}
                    >
                      {editLabel}
                    </a>
                  ) : null}
                  {state === "current" ? (
                    <span data-part="now">Сейчас</span>
                  ) : null}
                  {state === "todo" ? (
                    <span data-part="state">Впереди</span>
                  ) : null}
                </li>
              )
            })}
          </ol>
        </div>
      </nav>
    </>
  )
}