Breadcrumb

Scrolling Trail

The trail scrolls sideways instead of wrapping: the current level sticks to the right edge and the cut is softened by a mask.

  • breadcrumb
  • scroll
  • mobile
  • path

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-005?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-005" (Scrolling 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-005.json

Registry item: https://vibeui.ru/r/breadcrumb-005.json
Installs to: components/vibeui/breadcrumb-005.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 trail scrolls sideways instead of wrapping: the current level sticks to the right edge and the cut is softened by a mask.

Breadcrumbs that scroll horizontally: nothing collapses, the current level sticks to the right edge and the cut is masked. Zero dependencies, one file, no client JS.

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

<Breadcrumb005 items={items} />

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-005-* palette — do not swap it for your theme tokens
- the edge mask: a hard cut reads as breakage
- sticky on the current level — it must stay visible at any scroll offset
- overscroll-behavior-x: contain, or the scroll escapes to the page
- the no-wrap rule: the whole point is that the path never collapses
- the visible scrollbar where the platform shows one

## 6. You may change
- the items array
- the mask width at the edge
- the accent through the accent prop
- the type size for your scale

## 7. Rules
- Horizontal scrolling is hard to notice with a mouse: on desktop prefer the collapse from breadcrumb-004.
- Scrolling starts at the left: if the end matters more, scroll the container from the caller.
- The mask paints over everything: keep interactive elements away from the right edge.
- 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-005.json
https://vibeui.ru/r/breadcrumb-005.json

Компонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-breadcrumb-005-*. Серверный: хуков нет. Список прокручивается по горизонтали, правый край подтёрт mask-градиентом, а текущий уровень объявлен position: sticky у правого края, поэтому он виден при любой прокрутке. overscroll-behavior-x: contain не даёт прокрутке уйти на страницу.

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

export type Breadcrumb005Props = Omit<
  ComponentPropsWithoutRef<"nav">,
  "children"
> & {
  items?: Breadcrumb005Item[]
  accent?: string
}

// Идея компонента: путь не переносится и не сворачивается, а прокручивается
// вбок. Такой вариант нужен там, где важен каждый уровень: в файловом
// менеджере и в админке. Край подтёрт градиентом-маской — обрубленная
// строка иначе выглядит поломкой, а не продолжением.
const STYLES = `
:where([data-vibeui-block="breadcrumb-005"]){
--vibeui-breadcrumb-005-surface:oklch(1 0 0);
--vibeui-breadcrumb-005-surface-border:oklch(0.91 0.006 265);
--vibeui-breadcrumb-005-fg:oklch(0.28 0.016 265);
--vibeui-breadcrumb-005-muted:oklch(0.56 0.014 265);
--vibeui-breadcrumb-005-accent:oklch(0.55 0.17 265);
--vibeui-breadcrumb-005-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
/* Собственная подложка: крошки — это текст, и на тёмной странице
   он обязан читаться без правки палитры проекта. */
[data-vibeui-block="breadcrumb-005"]{
box-sizing:border-box;padding:0.5rem 0.75rem;
background:var(--vibeui-breadcrumb-005-surface);
border:1px solid var(--vibeui-breadcrumb-005-surface-border);border-radius:0.625rem;
display:block;width:100%;box-sizing:border-box;
font-family:var(--vibeui-breadcrumb-005-font);font-size:0.8125rem;line-height:1.4;
color:var(--vibeui-breadcrumb-005-muted);
}
/* Прокрутка вбок вместо переноса: каждый уровень остаётся на месте. */
[data-vibeui-block="breadcrumb-005"] ol{
display:flex;align-items:center;gap:0.375rem;
margin:0;padding:0.125rem 1.25rem 0.375rem 0;list-style:none;
overflow-x:auto;overscroll-behavior-x:contain;
scrollbar-width:thin;
/* Маска у правого края: обрубленная строка читается как продолжение. */
mask:linear-gradient(to right,oklch(0 0 0) calc(100% - 1.25rem),transparent);
}
[data-vibeui-block="breadcrumb-005"] li{display:inline-flex;align-items:center;gap:0.375rem;flex:none;white-space:nowrap}
[data-vibeui-block="breadcrumb-005"] li + li::before{content:"/";color:oklch(0.75 0.01 265)}
[data-vibeui-block="breadcrumb-005"] a{color:inherit;text-decoration:none;border-radius:0.25rem}
[data-vibeui-block="breadcrumb-005"] a:hover{color:var(--vibeui-breadcrumb-005-fg);text-decoration:underline;text-underline-offset:3px}
[data-vibeui-block="breadcrumb-005"] a:focus-visible{outline:2px solid var(--vibeui-breadcrumb-005-accent);outline-offset:2px}
/* Текущий уровень прилипает к правому краю: он важнее всех остальных. */
[data-vibeui-block="breadcrumb-005"] [aria-current="page"]{
position:sticky;right:0;color:var(--vibeui-breadcrumb-005-fg);font-weight:600;
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="breadcrumb-005"] *{animation:none!important;transition:none!important}}
`

const DEFAULT_ITEMS: Breadcrumb005Item[] = [
  { label: "Диск", href: "#" },
  { label: "Проекты", href: "#" },
  { label: "VibeUI", href: "#" },
  { label: "registry", href: "#" },
  { label: "components", href: "#" },
  { label: "breadcrumb", href: "#" },
  { label: "breadcrumb-005.tsx" },
]

/**
 * Путь с прокруткой вбок: уровни не сворачиваются и не переносятся.
 * Один файл, ноль зависимостей, собственная палитра.
 */
export function Breadcrumb005({
  items = DEFAULT_ITEMS,
  accent,
  className,
  style,
  ...props
}: Breadcrumb005Props) {
  const palette = {
    ...(accent ? { "--vibeui-breadcrumb-005-accent": accent } : null),
    ...style,
  } as CSSProperties

  return (
    <>
      <style href="vibeui-breadcrumb-005" precedence="medium">
        {STYLES}
      </style>
      <nav
        {...props}
        data-vibeui-block="breadcrumb-005"
        aria-label="Хлебные крошки"
        className={className}
        style={palette}
      >
        <ol>
          {items.map((item, index) => {
            const last = index === items.length - 1

            return (
              <li key={item.label}>
                {item.href && !last ? (
                  <a href={item.href}>{item.label}</a>
                ) : (
                  <span aria-current={last ? "page" : undefined}>
                    {item.label}
                  </span>
                )}
              </li>
            )
          })}
        </ol>
      </nav>
    </>
  )
}