Breadcrumb

Parent Link

Breadcrumbs for a phone: one named parent link plus the current level — nobody reads a full path on a narrow screen anyway.

  • breadcrumb
  • mobile
  • back
  • compact

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-012?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-012" (Parent Link) 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-012.json

Registry item: https://vibeui.ru/r/breadcrumb-012.json
Installs to: components/vibeui/breadcrumb-012.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
Breadcrumbs for a phone: one named parent link plus the current level — nobody reads a full path on a narrow screen anyway.

Compact breadcrumbs: an arrow and the parent's name as a link, followed by the truncated current level. Zero dependencies, one file, no client JS.

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

<Breadcrumb012 parentLabel="Components" currentLabel="Breadcrumbs" />

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-012-* palette — do not swap it for your theme tokens
- naming the parent: "Back" does not say where it leads
- the 2rem tap target — this is the most-tapped link on a phone
- a link to the parent instead of history.back: back and up are different directions
- truncating the current level with an ellipsis
- aria-current="page" on the current level

## 6. You may change
- parentLabel and parentHref
- currentLabel
- the accent through the accent prop
- the separator between parent and current

## 7. Rules
- This is not the browser back button: the link goes one level up, not one page back.
- On desktop a full path serves better: show this variant only at narrow widths.
- With no parent (a top-level page) render no link at all rather than pointing at home.
- 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-012.json
https://vibeui.ru/r/breadcrumb-012.json

Компонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-breadcrumb-012-*. Серверный: хуков нет. Ссылка на родителя названа словом и имеет высоту 2rem — на телефоне это самая нажимаемая цель на странице. Текущий уровень режется многоточием и помечен aria-current. Стрелка нарисована бордюрами.

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 Breadcrumb012Props = Omit<
  ComponentPropsWithoutRef<"nav">,
  "children"
> & {
  parentLabel?: string
  parentHref?: string
  currentLabel?: string
  accent?: string
}

// Идея компонента: крошки для телефона — одна ссылка «назад к родителю».
// Полный путь на узком экране всё равно не читают: он занимает две строки и
// тянет вниз содержимое. Родитель назван словами, а не безымянной стрелкой:
// «Назад» не отвечает, куда именно вернёт.
const STYLES = `
:where([data-vibeui-block="breadcrumb-012"]){
--vibeui-breadcrumb-012-surface:oklch(1 0 0);
--vibeui-breadcrumb-012-surface-border:oklch(0.91 0.006 265);
--vibeui-breadcrumb-012-fg:oklch(0.26 0.016 265);
--vibeui-breadcrumb-012-muted:oklch(0.56 0.014 265);
--vibeui-breadcrumb-012-accent:oklch(0.55 0.17 265);
--vibeui-breadcrumb-012-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
/* Собственная подложка: крошки — это текст, и на тёмной странице
   он обязан читаться без правки палитры проекта. */
[data-vibeui-block="breadcrumb-012"]{
box-sizing:border-box;padding:0.5rem 0.75rem;
background:var(--vibeui-breadcrumb-012-surface);
border:1px solid var(--vibeui-breadcrumb-012-surface-border);border-radius:0.625rem;
display:flex;align-items:center;gap:0.5rem;min-width:0;
font-family:var(--vibeui-breadcrumb-012-font);font-size:0.8125rem;line-height:1.4;
color:var(--vibeui-breadcrumb-012-muted);
}
[data-vibeui-block="breadcrumb-012"] a{
display:inline-flex;align-items:center;gap:0.375rem;flex:none;
color:inherit;text-decoration:none;
/* Высота под палец: ссылка «назад» на телефоне нажимается чаще всего. */
min-height:2rem;padding:0 0.375rem 0 0.25rem;border-radius:0.4375rem;
}
[data-vibeui-block="breadcrumb-012"] a:hover{color:var(--vibeui-breadcrumb-012-fg);background:oklch(0.96 0.004 265)}
[data-vibeui-block="breadcrumb-012"] a:focus-visible{outline:2px solid var(--vibeui-breadcrumb-012-accent);outline-offset:2px}
/* Стрелка влево из двух бордюров. */
[data-vibeui-block="breadcrumb-012"] [data-part="arrow"]{
width:0.4375rem;height:0.4375rem;flex:none;
border-left:1.5px solid currentColor;border-bottom:1.5px solid currentColor;
transform:rotate(45deg);
}
[data-vibeui-block="breadcrumb-012"] [data-part="current"]{
min-width:0;color:var(--vibeui-breadcrumb-012-fg);font-weight:600;
overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
[data-vibeui-block="breadcrumb-012"] [data-part="dot"]{flex:none;color:oklch(0.78 0.01 265)}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="breadcrumb-012"] *{animation:none!important;transition:none!important}}
`

/**
 * Крошки для телефона: одна названная ссылка на родителя и текущий уровень.
 * Один файл, ноль зависимостей, собственная палитра.
 */
export function Breadcrumb012({
  parentLabel = "Компоненты",
  parentHref = "#",
  currentLabel = "Хлебные крошки для телефона",
  accent,
  className,
  style,
  ...props
}: Breadcrumb012Props) {
  const palette = {
    ...(accent ? { "--vibeui-breadcrumb-012-accent": accent } : null),
    ...style,
  } as CSSProperties

  return (
    <>
      <style href="vibeui-breadcrumb-012" precedence="medium">
        {STYLES}
      </style>
      <nav
        {...props}
        data-vibeui-block="breadcrumb-012"
        aria-label="Хлебные крошки"
        className={className}
        style={palette}
      >
        <a href={parentHref}>
          <span data-part="arrow" aria-hidden="true" />
          {parentLabel}
        </a>
        <span data-part="dot" aria-hidden="true">
          /
        </span>
        <span data-part="current" aria-current="page">
          {currentLabel}
        </span>
      </nav>
    </>
  )
}