Breadcrumb

Wizard Trail

A wizard trail: completed steps are links with a tick, future ones carry only a number, and jumping ahead is impossible.

  • breadcrumb
  • wizard
  • steps
  • checkout

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/breadcrumb-009?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 "breadcrumb-009" (Wizard Trail) 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/breadcrumb-009.json

Registry item: https://vibeui.ru/r/breadcrumb-009.json
Installs to: components/vibeui/breadcrumb-009.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 wizard trail: completed steps are links with a tick, future ones carry only a number, and jumping ahead is impossible.

A wizard trail: a tick on completed steps, a number on future ones, links only backward. Zero dependencies, one file, no client JS.

## 3. How to use it
import { Breadcrumb009 } from "@/components/vibeui/breadcrumb-009"

<Breadcrumb009 steps={steps} current={2} />

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-breadcrumb-009-* palette — do not swap it for your theme tokens
- no forward jumps: the next step depends on answers given in this one
- the shape difference: a tick for done, a number for pending — colour is not the only cue
- aria-current="step" on the active step and the step number in the nav's aria-label
- the connector line as a separator, not a progress indicator
- wrapping to a second line: five steps and more are common

## 6. You may change
- the steps array and the current index
- the accent through the accent prop
- the completed-step colour
- the step labels

## 7. Rules
- This is navigation, not enforcement: routing must actually block forward jumps.
- More than five steps do not fit a line: split long wizards into stages.
- If a step is skippable, say so in words: a tick means done, not skipped.
- 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/breadcrumb-009.json
https://vibeui.ru/r/breadcrumb-009.json

Компонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-breadcrumb-009-*. Серверный: хуков нет. Состояние шага вычисляется из индекса и пропа current и выносится в data-state; ссылками становятся только пройденные шаги. Текущий шаг помечен aria-current="step", а вся навигация — aria-label с номером шага и их общим числом.

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 Breadcrumb009Step = {
  label: string
  href?: string
}

export type Breadcrumb009Props = Omit<
  ComponentPropsWithoutRef<"nav">,
  "children"
> & {
  steps?: Breadcrumb009Step[]
  current?: number
  accent?: string
}

// Идея компонента: путь мастера, где пройденное кликабельно, а будущее — нет.
// Разница между «уже был» и «ещё не был» показана не только цветом: у
// пройденных шагов галочка, у будущих — номер. Вперёд через крошки не
// прыгают: следующий шаг может зависеть от ответов на текущем.
const STYLES = `
:where([data-vibeui-block="breadcrumb-009"]){
--vibeui-breadcrumb-009-surface:oklch(1 0 0);
--vibeui-breadcrumb-009-surface-border:oklch(0.91 0.006 265);
--vibeui-breadcrumb-009-fg:oklch(0.26 0.016 265);
--vibeui-breadcrumb-009-muted:oklch(0.6 0.014 265);
--vibeui-breadcrumb-009-line:oklch(0.86 0.008 265);
--vibeui-breadcrumb-009-accent:oklch(0.55 0.17 265);
--vibeui-breadcrumb-009-done:oklch(0.6 0.15 152);
--vibeui-breadcrumb-009-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
/* Собственная подложка: крошки — это текст, и на тёмной странице
   он обязан читаться без правки палитры проекта. */
[data-vibeui-block="breadcrumb-009"]{
box-sizing:border-box;padding:0.5rem 0.75rem;
background:var(--vibeui-breadcrumb-009-surface);
border:1px solid var(--vibeui-breadcrumb-009-surface-border);border-radius:0.625rem;
font-family:var(--vibeui-breadcrumb-009-font);font-size:0.8125rem;line-height:1.4;
color:var(--vibeui-breadcrumb-009-muted);
}
[data-vibeui-block="breadcrumb-009"] ol{
display:flex;flex-wrap:wrap;align-items:center;gap:0.5rem;
margin:0;padding:0;list-style:none;
}
[data-vibeui-block="breadcrumb-009"] li{display:inline-flex;align-items:center;gap:0.5rem}
[data-vibeui-block="breadcrumb-009"] li + li::before{
content:"";width:1rem;height:1px;background:var(--vibeui-breadcrumb-009-line);
}
[data-vibeui-block="breadcrumb-009"] [data-part="step"]{display:inline-flex;align-items:center;gap:0.375rem;color:inherit;text-decoration:none;border-radius:0.3125rem}
[data-vibeui-block="breadcrumb-009"] a[data-part="step"]:hover{color:var(--vibeui-breadcrumb-009-fg)}
[data-vibeui-block="breadcrumb-009"] a[data-part="step"]:focus-visible{outline:2px solid var(--vibeui-breadcrumb-009-accent);outline-offset:2px}
/* Метка шага: у пройденных галочка, у остальных номер. */
[data-vibeui-block="breadcrumb-009"] [data-part="mark"]{
display:inline-flex;align-items:center;justify-content:center;flex:none;
width:1.125rem;height:1.125rem;border-radius:9999px;
border:1px solid var(--vibeui-breadcrumb-009-line);
font-size:0.625rem;font-weight:700;font-variant-numeric:tabular-nums;
}
[data-vibeui-block="breadcrumb-009"] [data-state="done"] [data-part="mark"]{
border-color:transparent;background:var(--vibeui-breadcrumb-009-done);color:oklch(0.99 0.01 152);
}
[data-vibeui-block="breadcrumb-009"] [data-state="current"] [data-part="mark"]{
border-color:var(--vibeui-breadcrumb-009-accent);color:var(--vibeui-breadcrumb-009-accent);
}
[data-vibeui-block="breadcrumb-009"] [data-state="current"]{color:var(--vibeui-breadcrumb-009-fg);font-weight:650}
[data-vibeui-block="breadcrumb-009"] [data-state="todo"]{color:var(--vibeui-breadcrumb-009-muted)}
[data-vibeui-block="breadcrumb-009"] [data-part="tick"]{
width:0.25rem;height:0.4375rem;margin-top:-0.0625rem;
border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;
transform:rotate(45deg);
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="breadcrumb-009"] *{animation:none!important;transition:none!important}}
`

const DEFAULT_STEPS: Breadcrumb009Step[] = [
  { label: "Корзина", href: "#" },
  { label: "Доставка", href: "#" },
  { label: "Оплата" },
  { label: "Готово" },
]

/**
 * Путь мастера: пройденные шаги кликабельны, будущие — нет.
 * Один файл, ноль зависимостей, собственная палитра.
 */
export function Breadcrumb009({
  steps = DEFAULT_STEPS,
  current = 2,
  accent,
  className,
  style,
  ...props
}: Breadcrumb009Props) {
  const palette = {
    ...(accent ? { "--vibeui-breadcrumb-009-accent": accent } : null),
    ...style,
  } as CSSProperties

  return (
    <>
      <style href="vibeui-breadcrumb-009" precedence="medium">
        {STYLES}
      </style>
      <nav
        {...props}
        data-vibeui-block="breadcrumb-009"
        aria-label={`Шаг ${current + 1} из ${steps.length}`}
        className={className}
        style={palette}
      >
        <ol>
          {steps.map((step, index) => {
            const state =
              index < current ? "done" : index === current ? "current" : "todo"
            const content = (
              <>
                <span data-part="mark" aria-hidden="true">
                  {state === "done" ? <span data-part="tick" /> : index + 1}
                </span>
                {step.label}
              </>
            )

            return (
              <li key={step.label} data-state={state}>
                {state === "done" && step.href ? (
                  <a data-part="step" href={step.href}>
                    {content}
                  </a>
                ) : (
                  <span
                    data-part="step"
                    aria-current={state === "current" ? "step" : undefined}
                  >
                    {content}
                  </span>
                )}
              </li>
            )
          })}
        </ol>
      </nav>
    </>
  )
}