Breadcrumb
Pending Segment
The path is known from the route while the last segment's name is still loading: a skeleton bar of a set width holds its place, so the row never jumps.
- breadcrumb
- skeleton
- loading
- async
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/breadcrumb-015?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-015" (Pending Segment) 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-015.json
Registry item: https://vibeui.ru/r/breadcrumb-015.json
Installs to: components/vibeui/breadcrumb-015.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 path is known from the route while the last segment's name is still loading: a skeleton bar of a set width holds its place, so the row never jumps.
Breadcrumbs for a page whose path is known instantly while the record name arrives by request: the last segment holds its place with a skeleton and announces the wait to assistive tech. Zero dependencies, one file.
## 3. How to use it
import { Breadcrumb015 } from "@/components/vibeui/breadcrumb-015"
<Breadcrumb015
trail={["Catalog", "Suppliers", "Batches"]}
currentLabel="Batch A-1180"
loading={false}
placeholderWidth={12}
/>
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-015-* palette — do not swap it for your theme tokens
- the reserved space for the name: without it the row jumps and everything below shifts
- the placeholder width in ch — tied to the row's font, not to screen pixels
- aria-busy and the role="status" live region: a loading state must not be announced by colour alone
- the prefers-reduced-motion rule: a travelling sheen and a pulse are a classic vestibular trigger
- the breadcrumbs' own light surface: without it the dark text disappears on a dark background
## 6. You may change
- the path through trail and the record name through currentLabel
- the state through loading — at false the name replaces the bar
- the reserved space through placeholderWidth, in characters
- the waiting text through loadingText and the accent through accent
## 7. Rules
- Set placeholderWidth to the average name length: an over-wide bar reads as a failed load.
- The live region speaks the waiting text once; the finished name is announced by the page itself, so do not duplicate it in the status.
- A skeleton fits a couple of seconds: longer waits need an explicit delay message, not an endless sheen.
- 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-015.jsonhttps://vibeui.ru/r/breadcrumb-015.jsonКомпонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-breadcrumb-015-*. Серверный: состояние приходит пропом loading, хуков нет. Ширина заглушки задана в ch через переменную --vibeui-breadcrumb-015-width, которую проп placeholderWidth ставит инлайном: единицы ch привязаны к шрифту самой строки, поэтому место под имя резервируется одинаково при любом размере текста. Блик — сдвиг background-position на фоновом градиенте, без лишних узлов; пульсирующая точка дублирует состояние формой. Загрузка объявлена через aria-busy на элементе списка и скрытую живую область role="status", а не одним цветом.
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 Breadcrumb015Props = Omit<
ComponentPropsWithoutRef<"nav">,
"children"
> & {
trail?: string[]
currentLabel?: string
loading?: boolean
placeholderWidth?: number
loadingText?: string
accent?: string
}
// Идея компонента: путь известен из маршрута сразу, а имя последнего
// сегмента приходит из запроса. Вместо пустоты или прыжка вёрстки на
// последнем месте стоит полоса-скелетон заранее заданной ширины: строка
// крошек не меняет высоту и не смещает соседние блоки, когда имя приедет.
// Состояние объявлено через aria-busy и живую область, а не одним цветом.
const STYLES = `
:where([data-vibeui-block="breadcrumb-015"]){
--vibeui-breadcrumb-015-surface:oklch(1 0 0);
--vibeui-breadcrumb-015-surface-border:oklch(0.91 0.006 265);
--vibeui-breadcrumb-015-fg:oklch(0.26 0.016 265);
--vibeui-breadcrumb-015-muted:oklch(0.56 0.014 265);
--vibeui-breadcrumb-015-faint:oklch(0.78 0.01 265);
--vibeui-breadcrumb-015-bone:oklch(0.93 0.005 265);
--vibeui-breadcrumb-015-sheen:oklch(0.975 0.003 265);
--vibeui-breadcrumb-015-accent:oklch(0.55 0.17 265);
--vibeui-breadcrumb-015-width:10ch;
--vibeui-breadcrumb-015-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
/* Собственная светлая подложка: крошки — это тёмный текст, и на тёмной
карточке каталога он обязан читаться без правки темы проекта. */
[data-vibeui-block="breadcrumb-015"]{
box-sizing:border-box;width:100%;max-width:34rem;
padding:0.5rem 0.75rem;
background:var(--vibeui-breadcrumb-015-surface);
border:1px solid var(--vibeui-breadcrumb-015-surface-border);border-radius:0.625rem;
font-family:var(--vibeui-breadcrumb-015-font);font-size:0.8125rem;line-height:1.4;
color:var(--vibeui-breadcrumb-015-muted);
}
[data-vibeui-block="breadcrumb-015"] ol{
display:flex;flex-wrap:wrap;align-items:center;gap:0.4375rem;
margin:0;padding:0;list-style:none;
}
[data-vibeui-block="breadcrumb-015"] li{position:relative;display:inline-flex;align-items:center;gap:0.4375rem}
[data-vibeui-block="breadcrumb-015"] li + li::before{content:"/";color:var(--vibeui-breadcrumb-015-faint)}
[data-vibeui-block="breadcrumb-015"] a{color:inherit;text-decoration:none;border-radius:0.25rem}
[data-vibeui-block="breadcrumb-015"] a:hover{color:var(--vibeui-breadcrumb-015-fg);text-decoration:underline;text-underline-offset:3px}
[data-vibeui-block="breadcrumb-015"] a:focus-visible{outline:2px solid var(--vibeui-breadcrumb-015-accent);outline-offset:2px}
[data-vibeui-block="breadcrumb-015"] [data-part="current"]{color:var(--vibeui-breadcrumb-015-fg);font-weight:600}
/* Место под имя занято заранее: ширина полосы задана в ch, поэтому она
не зависит от размера шрифта родителя и строка не прыгает при загрузке. */
[data-vibeui-block="breadcrumb-015"] [data-part="skeleton"]{
display:inline-block;vertical-align:middle;
width:var(--vibeui-breadcrumb-015-width);height:0.75rem;border-radius:0.25rem;
background-color:var(--vibeui-breadcrumb-015-bone);
background-image:linear-gradient(
90deg,
var(--vibeui-breadcrumb-015-bone) 0%,
var(--vibeui-breadcrumb-015-sheen) 50%,
var(--vibeui-breadcrumb-015-bone) 100%);
background-size:220% 100%;background-repeat:no-repeat;
animation:vibeui-breadcrumb-015-sweep 1.4s linear infinite;
}
/* Пульсирующая точка перед полосой: без анимации состояние ещё читается
формой, а вместе с ней — сразу видно, что ждём ответа. */
[data-vibeui-block="breadcrumb-015"] [data-part="dot"]{
width:0.375rem;height:0.375rem;border-radius:50%;
background:var(--vibeui-breadcrumb-015-accent);
animation:vibeui-breadcrumb-015-pulse 1.4s ease-in-out infinite;
}
[data-vibeui-block="breadcrumb-015"] [data-part="status"]{
position:absolute;width:1px;height:1px;overflow:hidden;
clip-path:inset(50%);white-space:nowrap;
}
@keyframes vibeui-breadcrumb-015-sweep{
from{background-position:160% 0}
to{background-position:-60% 0}
}
@keyframes vibeui-breadcrumb-015-pulse{
0%,100%{opacity:.35;transform:scale(.85)}
50%{opacity:1;transform:scale(1)}
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="breadcrumb-015"] *{animation:none!important;transition:none!important}}
`
const DEFAULT_TRAIL = ["Каталог", "Поставщики", "Партии"]
/**
* Путь известен сразу, имя последнего сегмента подгружается: место
* под него занимает скелетон. Один файл, ноль зависимостей, своя палитра.
*/
export function Breadcrumb015({
trail = DEFAULT_TRAIL,
currentLabel = "Партия A-1180",
loading = true,
placeholderWidth = 10,
loadingText = "Загружаем название",
accent,
className,
style,
...props
}: Breadcrumb015Props) {
const palette = {
"--vibeui-breadcrumb-015-width": `${placeholderWidth}ch`,
...(accent ? { "--vibeui-breadcrumb-015-accent": accent } : null),
...style,
} as CSSProperties
return (
<>
<style href="vibeui-breadcrumb-015" precedence="medium">
{STYLES}
</style>
<nav
{...props}
data-vibeui-block="breadcrumb-015"
aria-label="Хлебные крошки"
className={className}
style={palette}
>
<ol>
{trail.map((label) => (
<li key={label}>
<a href="#">{label}</a>
</li>
))}
<li aria-busy={loading || undefined}>
{loading ? (
<>
<span data-part="dot" aria-hidden="true" />
<span data-part="skeleton" aria-hidden="true" />
</>
) : (
<span data-part="current" aria-current="page">
{currentLabel}
</span>
)}
<span data-part="status" role="status">
{loading ? loadingText : ""}
</span>
</li>
</ol>
</nav>
</>
)
}