Breadcrumb

Slash Breadcrumb

Minimal crumbs with no chrome: the separator is drawn in CSS, so a screen reader never reads "slash" at every level.

  • breadcrumb
  • navigation
  • minimal
  • a11y

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-002?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-002" (Slash Breadcrumb) 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-002.json

Registry item: https://vibeui.ru/r/breadcrumb-002.json
Installs to: components/vibeui/breadcrumb-002.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
Minimal crumbs with no chrome: the separator is drawn in CSS, so a screen reader never reads "slash" at every level.

Plain breadcrumbs: a list of links, a CSS separator and a current level that is not a link. Zero dependencies, one file, no client JS.

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

<Breadcrumb002
  items={[{ label: "Home", href: "/" }, { label: "Catalog" }]}
  separator="/"
/>

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-002-* palette — do not swap it for your theme tokens
- the separator as a pseudo-element: a character in the markup is read at every level
- nav with aria-label wrapping an <ol> — the order of levels is the whole point
- aria-current="page" on the last level instead of a link to the current page
- the underline on hover: colour alone does not mark a link
- wrapping to a second line rather than clipping horizontally

## 6. You may change
- the items array
- separator — the character between levels
- the accent through the accent prop — the focus ring
- the type size for your scale

## 7. Rules
- This variant does not collapse a long path: use breadcrumb-001 or breadcrumb-004 for that.
- The separator is decoration, not content: do not put meaningful arrows in it.
- Breadcrumbs show position in a structure, not history: they are not a back button.
- 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-002.json
https://vibeui.ru/r/breadcrumb-002.json

Компонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-breadcrumb-002-*. Серверный: хуков нет. Разметка — nav с aria-label и упорядоченный список: порядок уровней несёт смысл. Разделитель приходит через переменную и печатается псевдоэлементом li + li::before. Последний уровень рендерится span с aria-current="page", а не ссылкой.

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

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

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

const DEFAULT_ITEMS: Breadcrumb002Item[] = [
  { label: "Главная", href: "#" },
  { label: "Каталог", href: "#" },
  { label: "Компоненты", href: "#" },
  { label: "Хлебные крошки" },
]

/**
 * Минимальные крошки: разделитель в CSS, текущий уровень без ссылки.
 * Один файл, ноль зависимостей, собственная палитра.
 */
export function Breadcrumb002({
  items = DEFAULT_ITEMS,
  separator = "/",
  accent,
  className,
  style,
  ...props
}: Breadcrumb002Props) {
  const palette = {
    "--vibeui-breadcrumb-002-separator": `"${separator}"`,
    ...(accent ? { "--vibeui-breadcrumb-002-accent": accent } : null),
    ...style,
  } as CSSProperties

  return (
    <>
      <style href="vibeui-breadcrumb-002" precedence="medium">
        {STYLES}
      </style>
      <nav
        {...props}
        data-vibeui-block="breadcrumb-002"
        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>
    </>
  )
}