Bar
Transparent at rest. On scroll it gains paper and a hairline.
Keeps the current path visible while scrolling. Fixed at 72px with a 1px bottom rule when active.
Transparent at rest. On scroll it gains paper and a hairline.
Three ways in. They share one source, so the pixels match whichever you pick.
npm install @noorddev/vlak-react
// once, next to your app's root
import "@noorddev/vlak-react/css";
import { CrumbBar } from "@noorddev/vlak-react";Precompiled React and one stylesheet. No compiler to configure. Per-component imports work too: @noorddev/vlak-react/components/crumb-bar.
npx @noorddev/vlak-cli add crumb-bar
The StyleX leaf lands in components/vlak/ with its dependencies, for your own compiler to own. See StyleX.
npx shadcn add https://vlak.dev/r/crumb-bar.json
The same registry item, installed by shadcn's CLI.
<link rel="stylesheet" href="node_modules/@noorddev/vlak/css/vlak.css" />
No React. Link vlak.css and use the markup and classes below.
import { CrumbBar } from "@noorddev/vlak-react";
<CrumbBar
root={{ label: "Renato Valdés Olmos", href: "/" }}
rootShort="RVO"
trail={[{ label: "Components", href: "/components" }, { label: "Switch" }]}
threshold={110}
/>The fixed top bar of the house chrome. Transparent at rest; once the page cover scrolls away it gains the paper background and its bottom hairline, and the breadcrumbs fade in. While hidden the trail is inert and invisible, so nothing focuses into an unseen link.
| Prop | Type | Default | Description |
|---|---|---|---|
trailrequired | CrumbBarItem[] | ||
threshold | number | 110 | Pixels of scroll before the bar solidifies and the crumbs fade in. |
root | CrumbBarItem | Root crumb, held in the TOC column from 900px. | |
rootShort | ReactNode | Abbreviated root shown on phones in place of the full label. |
Also accepts HTMLAttributes<HTMLElement>.
| Keys | Does |
|---|---|
| Tab | Moves to the root link, then the trail links once the bar is scrolled in |
| Enter | Follows the link |
<nav class="rs-crumb-bar rs-crumb-bar-scrolled"><div class="rs-crumb-bar-inner"><a class="rs-crumb-root" href="/"><span class="rs-crumb-root-full">Vlak</span><span class="rs-crumb-root-short">rs</span></a><p class="rs-crumbs"><span>Docs</span><span class="rs-crumbs-sep">/</span><span class="rs-crumbs-here">Components</span></p></div></nav>