Navigation
Step States
Steps with the full set of states: done, error, skipped, current and upcoming. Each has its own glyph and its own word, not just a colour.
- stepper
- states
- error
- accessibility
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/stepper-004?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-004" (Step States) 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-004.json
Registry item: https://vibeui.ru/r/stepper-004.json
Installs to: components/vibeui/stepper-004.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
Steps with the full set of states: done, error, skipped, current and upcoming. Each has its own glyph and its own word, not just a colour.
Steps with done, error, skipped and current states: a glyph, a shape and a word rather than colour alone. Zero dependencies, one file, no client JS.
## 3. How to use it
import { Stepper004 } from "@/components/vibeui/stepper-004"
<Stepper004
label="Store setup"
accent="#4f46e5"
/>
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-004-* palette — do not swap it for your theme tokens
- the state word under the title: colour and glyph are indistinguishable to colour-blind readers
- the dashed ring on a skipped step: shape backs up colour where colour fails
- aria-current="step" on the current step: without it the order is lost when announced
- aria-hidden on the ✓, ! and ↷ glyphs: on their own they sound like stray symbols
- the component's own light surface: dark text disappears on the dark catalog card
## 6. You may change
- the steps and their states through steps
- the list's accessible name through label
- the main colour through accent
- the state wording by editing the MARKS and WORDS tables
## 7. Rules
- State is explicit: the component neither derives it from an index nor checks that only one step is current.
- An errored step does not block the following ones — that is the form's decision, not the indicator's.
- Five steps are already tight on a phone: below 30rem the hints hide and only titles remain.
- 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-004.jsonhttps://vibeui.ru/r/stepper-004.jsonКомпонент самодостаточен: один файл, без зависимостей, палитра в переменных --vibeui-stepper-004-*. Серверный: хуков нет. Состояние приходит данными, а не выводится из номера: пропущенный шаг может стоять между пройденными. Цвет пункта задаётся одной переменной --vibeui-stepper-004-tone, от неё красятся кружок, рамка и подпись — новое состояние добавляется одной строкой CSS плюс знаком в MARKS и словом в WORDS. Соединитель берёт цвет левого соседа через инлайновую переменную, поэтому разрыв виден ровно на месте ошибки. Пропущенный шаг дополнительно помечен пунктирной рамкой: форма работает там, где не работает цвет.
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 Stepper004State = "done" | "error" | "skipped" | "current" | "todo"
export type Stepper004Step = {
title: string
state: Stepper004State
hint?: string
}
export type Stepper004Props = Omit<
ComponentPropsWithoutRef<"nav">,
"children"
> & {
steps?: Stepper004Step[]
label?: string
accent?: string
}
// Идея компонента: состояние шага задаётся не только цветом. У каждого свой
// знак (✓, !, ↷) и своя подпись словом под заголовком, поэтому «ошибка» и
// «пропущен» различимы при дальтонизме и в чёрно-белой печати. Соединитель
// красится по состоянию левого соседа, поэтому разрыв виден на месте ошибки.
const STYLES = `
:where([data-vibeui-block="stepper-004"]){
--vibeui-stepper-004-bg:oklch(1 0 0);
--vibeui-stepper-004-fg:oklch(0.24 0.016 265);
--vibeui-stepper-004-muted:oklch(0.56 0.014 265);
--vibeui-stepper-004-border:oklch(0.92 0.006 265);
--vibeui-stepper-004-line:oklch(0.9 0.006 265);
--vibeui-stepper-004-accent:oklch(0.55 0.2 262);
--vibeui-stepper-004-done:oklch(0.55 0.14 155);
--vibeui-stepper-004-error:oklch(0.55 0.19 27);
--vibeui-stepper-004-skip:oklch(0.65 0.03 265);
--vibeui-stepper-004-on:oklch(1 0 0);
--vibeui-stepper-004-size:2rem;
--vibeui-stepper-004-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-vibeui-block="stepper-004"]{
container-type:inline-size;width:100%;box-sizing:border-box;
font-family:var(--vibeui-stepper-004-font);color:var(--vibeui-stepper-004-fg);
}
[data-vibeui-block="stepper-004"] [data-part="shell"]{
background:var(--vibeui-stepper-004-bg);
border:1px solid var(--vibeui-stepper-004-border);
border-radius:1rem;padding:1.125rem 1rem 1rem;
}
[data-vibeui-block="stepper-004"] ol{
display:flex;margin:0;padding:0;list-style:none;gap:0;
}
[data-vibeui-block="stepper-004"] li{
position:relative;flex:1 1 0;min-width:0;
display:flex;flex-direction:column;align-items:center;text-align:center;gap:0.375rem;
--vibeui-stepper-004-tone:var(--vibeui-stepper-004-line);
}
[data-vibeui-block="stepper-004"] li[data-state="done"]{--vibeui-stepper-004-tone:var(--vibeui-stepper-004-done)}
[data-vibeui-block="stepper-004"] li[data-state="error"]{--vibeui-stepper-004-tone:var(--vibeui-stepper-004-error)}
[data-vibeui-block="stepper-004"] li[data-state="skipped"]{--vibeui-stepper-004-tone:var(--vibeui-stepper-004-skip)}
[data-vibeui-block="stepper-004"] li[data-state="current"]{--vibeui-stepper-004-tone:var(--vibeui-stepper-004-accent)}
/* Соединитель берёт цвет левого соседа: разрыв видно на месте ошибки. */
[data-vibeui-block="stepper-004"] li:not(:first-child)::before{
content:"";position:absolute;top:calc(var(--vibeui-stepper-004-size) / 2 - 1px);
right:50%;left:-50%;height:2px;background:var(--vibeui-stepper-004-line);
}
[data-vibeui-block="stepper-004"] li[data-linked="true"]::before{
background:var(--vibeui-stepper-004-link);
}
[data-vibeui-block="stepper-004"] [data-part="mark"]{
position:relative;z-index:1;
display:flex;align-items:center;justify-content:center;
width:var(--vibeui-stepper-004-size);height:var(--vibeui-stepper-004-size);
border-radius:9999px;border:2px solid var(--vibeui-stepper-004-tone);
background:var(--vibeui-stepper-004-bg);color:var(--vibeui-stepper-004-tone);
font-size:0.8125rem;font-weight:700;line-height:1;
}
[data-vibeui-block="stepper-004"] li[data-state="done"] [data-part="mark"],
[data-vibeui-block="stepper-004"] li[data-state="error"] [data-part="mark"]{
background:var(--vibeui-stepper-004-tone);color:var(--vibeui-stepper-004-on);
}
[data-vibeui-block="stepper-004"] li[data-state="skipped"] [data-part="mark"]{
border-style:dashed;
}
[data-vibeui-block="stepper-004"] li[data-state="current"] [data-part="mark"]{
box-shadow:0 0 0 3px color-mix(in oklab,var(--vibeui-stepper-004-accent) 18%,transparent);
}
[data-vibeui-block="stepper-004"] [data-part="title"]{
font-size:0.8125rem;font-weight:600;line-height:1.25;
}
[data-vibeui-block="stepper-004"] li[data-state="todo"] [data-part="title"],
[data-vibeui-block="stepper-004"] li[data-state="skipped"] [data-part="title"]{
font-weight:500;color:var(--vibeui-stepper-004-muted);
}
[data-vibeui-block="stepper-004"] [data-part="state"]{
font-size:0.6875rem;font-weight:650;line-height:1.2;color:var(--vibeui-stepper-004-tone);
}
[data-vibeui-block="stepper-004"] li[data-state="todo"] [data-part="state"]{color:var(--vibeui-stepper-004-muted)}
[data-vibeui-block="stepper-004"] [data-part="hint"]{
font-size:0.6875rem;line-height:1.3;color:var(--vibeui-stepper-004-muted);
}
@container (max-width: 30rem){
[data-vibeui-block="stepper-004"] [data-part="shell"] [data-part="hint"]{display:none}
[data-vibeui-block="stepper-004"] [data-part="shell"] [data-part="title"]{font-size:0.6875rem}
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="stepper-004"] *{animation:none!important;transition:none!important}}
`
const MARKS: Record<Stepper004State, string> = {
done: "✓",
error: "!",
skipped: "↷",
current: "•",
todo: "•",
}
const WORDS: Record<Stepper004State, string> = {
done: "Готово",
error: "Ошибка",
skipped: "Пропущен",
current: "Сейчас",
todo: "Впереди",
}
const DEFAULT_STEPS: Stepper004Step[] = [
{ title: "Аккаунт", state: "done", hint: "почта подтверждена" },
{ title: "Реквизиты", state: "error", hint: "не сходится ИНН" },
{ title: "Логотип", state: "skipped", hint: "можно добавить позже" },
{ title: "Оплата", state: "current", hint: "выберите способ" },
{ title: "Запуск", state: "todo" },
]
/**
* Шаги с разными состояниями: готово, ошибка, пропущен — знаком и словом.
* Один файл, ноль зависимостей, собственная палитра.
*/
export function Stepper004({
steps = DEFAULT_STEPS,
label = "Настройка магазина",
accent,
className,
style,
...props
}: Stepper004Props) {
const palette = {
...(accent ? { "--vibeui-stepper-004-accent": accent } : null),
...style,
} as CSSProperties
return (
<>
<style href="vibeui-stepper-004" precedence="medium">
{STYLES}
</style>
<nav
{...props}
data-vibeui-block="stepper-004"
aria-label={label}
className={className}
style={palette}
>
<div data-part="shell">
<ol>
{steps.map((step, index) => {
const previous = steps[index - 1]
const linked =
previous?.state === "done" || previous?.state === "skipped"
return (
<li
key={step.title}
data-state={step.state}
data-linked={linked ? "true" : undefined}
style={
{
"--vibeui-stepper-004-link":
previous?.state === "done"
? "var(--vibeui-stepper-004-done)"
: "var(--vibeui-stepper-004-skip)",
} as CSSProperties
}
aria-current={step.state === "current" ? "step" : undefined}
>
<span data-part="mark" aria-hidden="true">
{MARKS[step.state]}
</span>
<span data-part="title">{step.title}</span>
<span data-part="state">{WORDS[step.state]}</span>
{step.hint ? <span data-part="hint">{step.hint}</span> : null}
</li>
)
})}
</ol>
</div>
</nav>
</>
)
}