Breadcrumb
Sibling Switcher
The last level is a native select of sibling sections: switch in place without going back to the parent.
- breadcrumb
- select
- switch
- no-js
Preview
1440pxHost theme
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-011?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-011" (Sibling Switcher) 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-011.json
Registry item: https://vibeui.ru/r/breadcrumb-011.json
Installs to: components/vibeui/breadcrumb-011.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 last level is a native select of sibling sections: switch in place without going back to the parent.
Breadcrumbs whose last level is a select of sibling sections: switching happens in place, with no parent detour and no client code. Zero dependencies, one file.
## 3. How to use it
import { Breadcrumb011 } from "@/components/vibeui/breadcrumb-011"
<Breadcrumb011 rootLabel="Documents" siblings={["Contracts", "Invoices"]} defaultValue="Invoices" />
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-011-* palette — do not swap it for your theme tokens
- the native select: keyboard, type-ahead and the mobile wheel come free
- the hidden label tied to the select: an unnamed field is unnamed to a screen reader
- the border-drawn arrow — the built-in select arrow cannot be styled
- the thumb-sized control height
- the visible focus ring
## 6. You may change
- rootLabel, rootHref and the siblings array
- defaultValue — the current section
- label — the field's name
- the accent through the accent prop
## 7. Rules
- Selecting navigates nowhere by itself: wire an onChange in the caller.
- Keep the sibling list short: a long select reads badly, and that case wants the autocomplete category.
- A switcher fits equal siblings: it cannot stand in for a hierarchy.
- 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-011.jsonhttps://vibeui.ru/r/breadcrumb-011.jsonКомпонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-breadcrumb-011-*. Серверный компонент: useId нужен только для связи скрытой подписи с select. Список соседей — нативный <select>: клавиатура, поиск по первой букве и мобильный барабан достаются от браузера. Стрелка нарисована бордюрами, потому что штатную у select не стилизовать.
Component source
The same file your agent installs. Here in case you would rather copy it by hand.
import { useId } from "react"
import type { ComponentPropsWithoutRef, CSSProperties } from "react"
export type Breadcrumb011Props = Omit<
ComponentPropsWithoutRef<"nav">,
"children" | "defaultValue"
> & {
rootLabel?: string
rootHref?: string
siblings?: string[]
defaultValue?: string
label?: string
accent?: string
}
// Идея компонента: последний уровень — не текст, а нативный select с
// соседями. Переключиться между «Договоры» и «Счета» можно на месте, не
// возвращаясь в родительский раздел. Select нативный: он сам умеет
// клавиатуру, поиск по первой букве и мобильный барабан выбора.
const STYLES = `
:where([data-vibeui-block="breadcrumb-011"]){
--vibeui-breadcrumb-011-surface:oklch(1 0 0);
--vibeui-breadcrumb-011-surface-border:oklch(0.91 0.006 265);
--vibeui-breadcrumb-011-fg:oklch(0.26 0.016 265);
--vibeui-breadcrumb-011-muted:oklch(0.56 0.014 265);
--vibeui-breadcrumb-011-border:oklch(0.9 0.006 265);
--vibeui-breadcrumb-011-bg:oklch(0.98 0.002 265);
--vibeui-breadcrumb-011-accent:oklch(0.55 0.17 265);
--vibeui-breadcrumb-011-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
/* Собственная подложка: крошки — это текст, и на тёмной странице
он обязан читаться без правки палитры проекта. */
[data-vibeui-block="breadcrumb-011"]{
box-sizing:border-box;padding:0.5rem 0.75rem;
background:var(--vibeui-breadcrumb-011-surface);
border:1px solid var(--vibeui-breadcrumb-011-surface-border);border-radius:0.625rem;
font-family:var(--vibeui-breadcrumb-011-font);font-size:0.8125rem;line-height:1.4;
color:var(--vibeui-breadcrumb-011-muted);
}
[data-vibeui-block="breadcrumb-011"] ol{
display:flex;flex-wrap:wrap;align-items:center;gap:0.4375rem;
margin:0;padding:0;list-style:none;
}
[data-vibeui-block="breadcrumb-011"] li{display:inline-flex;align-items:center;gap:0.4375rem}
[data-vibeui-block="breadcrumb-011"] li + li::before{content:"/";color:oklch(0.78 0.01 265)}
[data-vibeui-block="breadcrumb-011"] a{color:inherit;text-decoration:none;border-radius:0.25rem}
[data-vibeui-block="breadcrumb-011"] a:hover{color:var(--vibeui-breadcrumb-011-fg);text-decoration:underline;text-underline-offset:3px}
[data-vibeui-block="breadcrumb-011"] a:focus-visible{outline:2px solid var(--vibeui-breadcrumb-011-accent);outline-offset:2px}
/* Нативный select: клавиатура, поиск по букве и мобильный барабан — даром. */
[data-vibeui-block="breadcrumb-011"] select{
appearance:none;cursor:pointer;
height:1.75rem;padding:0 1.5rem 0 0.5rem;
border:1px solid var(--vibeui-breadcrumb-011-border);border-radius:0.4375rem;
background:var(--vibeui-breadcrumb-011-bg);color:var(--vibeui-breadcrumb-011-fg);
font:inherit;font-size:0.8125rem;font-weight:600;
}
[data-vibeui-block="breadcrumb-011"] select:focus-visible{outline:2px solid var(--vibeui-breadcrumb-011-accent);outline-offset:2px}
[data-vibeui-block="breadcrumb-011"] [data-part="picker"]{position:relative;display:inline-flex;align-items:center}
[data-vibeui-block="breadcrumb-011"] [data-part="caret"]{
position:absolute;right:0.5rem;width:0.375rem;height:0.375rem;pointer-events:none;
margin-top:-0.1875rem;
border-right:1.5px solid var(--vibeui-breadcrumb-011-muted);
border-bottom:1.5px solid var(--vibeui-breadcrumb-011-muted);
transform:rotate(45deg);
}
[data-vibeui-block="breadcrumb-011"] [data-part="hint"]{
position:absolute;width:1px;height:1px;overflow:hidden;
clip-path:inset(50%);white-space:nowrap;
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="breadcrumb-011"] *{animation:none!important;transition:none!important}}
`
const DEFAULT_SIBLINGS = ["Договоры", "Счета", "Акты", "Доверенности"]
/**
* Последний уровень — нативный select с соседними разделами.
* Один файл, ноль зависимостей, собственная палитра.
*/
export function Breadcrumb011({
rootLabel = "Документы",
rootHref = "#",
siblings = DEFAULT_SIBLINGS,
defaultValue = "Счета",
label = "Раздел",
accent,
className,
style,
...props
}: Breadcrumb011Props) {
const id = useId()
const palette = {
...(accent ? { "--vibeui-breadcrumb-011-accent": accent } : null),
...style,
} as CSSProperties
return (
<>
<style href="vibeui-breadcrumb-011" precedence="medium">
{STYLES}
</style>
<nav
{...props}
data-vibeui-block="breadcrumb-011"
aria-label="Хлебные крошки"
className={className}
style={palette}
>
<ol>
<li>
<a href={rootHref}>{rootLabel}</a>
</li>
<li>
<span data-part="picker">
<label htmlFor={id} data-part="hint">
{label}
</label>
<select id={id} defaultValue={defaultValue}>
{siblings.map((sibling) => (
<option key={sibling} value={sibling}>
{sibling}
</option>
))}
</select>
<span data-part="caret" aria-hidden="true" />
</span>
</li>
</ol>
</nav>
</>
)
}