Breadcrumb
The path from the top of a section to the current page, as a row of links.
Use it on pages that sit more than one level deep, such as a role inside the roles list inside server settings. It shows where the page is and gives a one-click way back up. It is not a history of where the reader has been.
newt-breadcrumbimport { Breadcrumb, BreadcrumbItem } from "@/registry/bases/newt/ui/breadcrumb"
export default function BreadcrumbDemo() {
return (
<Breadcrumb>
<BreadcrumbItem href="#">Server settings</BreadcrumbItem>
<BreadcrumbItem href="#">Roles</BreadcrumbItem>
<BreadcrumbItem current>Moderator</BreadcrumbItem>
</Breadcrumb>
)
}<script setup lang="ts">
import {
Breadcrumb,
BreadcrumbItem,
} from "~~/registry/bases/newt/ui/breadcrumb"
</script>
<template>
<Breadcrumb>
<BreadcrumbItem href="#">Server settings</BreadcrumbItem>
<BreadcrumbItem href="#">Roles</BreadcrumbItem>
<BreadcrumbItem current>Moderator</BreadcrumbItem>
</Breadcrumb>
</template>Installation
npx newtui@latest add breadcrumbnpx shadcn@latest add @newtui/breadcrumbnpx shadcn-vue@latest add @newtui/breadcrumbpnpm dlx newtui@latest add breadcrumbpnpm dlx shadcn@latest add @newtui/breadcrumbpnpm dlx shadcn-vue@latest add @newtui/breadcrumbyarn dlx newtui@latest add breadcrumbyarn dlx shadcn@latest add @newtui/breadcrumbyarn dlx shadcn-vue@latest add @newtui/breadcrumbbunx newtui@latest add breadcrumbbunx shadcn@latest add @newtui/breadcrumbbunx shadcn-vue@latest add @newtui/breadcrumbdeno run -A npm:newtui@latest add breadcrumbdeno run -A npm:shadcn@latest add @newtui/breadcrumbdeno run -A npm:shadcn-vue@latest add @newtui/breadcrumbvlx newtui@latest add breadcrumbvlx shadcn@latest add @newtui/breadcrumbvlx shadcn-vue@latest add @newtui/breadcrumbvp dlx newtui@latest add breadcrumbvp dlx shadcn@latest add @newtui/breadcrumbvp dlx shadcn-vue@latest add @newtui/breadcrumbnubx newtui@latest add breadcrumbnubx shadcn@latest add @newtui/breadcrumbnubx shadcn-vue@latest add @newtui/breadcrumbnlx newtui@latest add breadcrumbnlx shadcn@latest add @newtui/breadcrumbnlx shadcn-vue@latest add @newtui/breadcrumbupx newtui@latest add breadcrumbupx shadcn@latest add @newtui/breadcrumbupx shadcn-vue@latest add @newtui/breadcrumb- newtui
- shadcn
- npm
- pnpm
- yarn
- bun
- deno
- vlt
- vp
- nub
- ni
- upm
The shadcn CLI needs the @newtui registry in your components.json. Set it up.
Copy the source into your project
import * as React from "react"
import { cn } from "@/lib/utils"
export interface BreadcrumbProps extends React.ComponentProps<"nav"> {
/** Accessible name of the landmark. */
label?: string
}
/*
* Where the page sits, as an ordered list inside a named `<nav>`. The
* separator is drawn by the stylesheet, so it is never read out and never
* copied with the text; a slash reads the same in either direction.
*/
const Breadcrumb = React.forwardRef<HTMLElement, BreadcrumbProps>(
({ className, label = "Breadcrumb", children, ...props }, ref) => (
<nav ref={ref} aria-label={label} className={className} {...props}>
<ol className="m-0 flex list-none flex-wrap items-center gap-1.5 p-0 text-sm leading-5">
{children}
</ol>
</nav>
)
)
Breadcrumb.displayName = "Breadcrumb"
export interface BreadcrumbItemProps extends React.ComponentProps<"li"> {
/** Where this level leads. Omit it to pass a router link as the child. */
href?: string
/** Marks the page the reader is on; it is text, not a link. */
current?: boolean
}
const BreadcrumbItem = React.forwardRef<HTMLLIElement, BreadcrumbItemProps>(
({ className, href, current = false, children, ...props }, ref) => (
<li
ref={ref}
className={cn(
// A router's own link, passed as the child, is styled from here.
"inline-flex min-w-0 items-center gap-1.5 text-newt-text-secondary [&:not(:first-child)]:before:text-newt-text-muted [&:not(:first-child)]:before:content-['/'] [&_a:focus-visible]:outline [&_a:focus-visible]:outline-2 [&_a:focus-visible]:outline-offset-2 [&_a:focus-visible]:outline-newt-text-link [&_a:hover]:text-newt-text-primary [&_a:hover]:underline [&_a]:rounded-[var(--newt-radius-sm)] [&_a]:text-newt-text-secondary [&_a]:no-underline [&_a]:transition-colors [&_a]:duration-fast [&_a]:ease-newt",
className
)}
{...props}
>
{current ? (
<span
aria-current="page"
className="truncate font-semibold text-newt-text-primary"
>
{children}
</span>
) : href === undefined ? (
children
) : (
<a href={href}>{children}</a>
)}
</li>
)
)
BreadcrumbItem.displayName = "BreadcrumbItem"
export { Breadcrumb, BreadcrumbItem }<script setup lang="ts">
import type { HTMLAttributes } from "vue"
/*
* Where the page sits, as an ordered list inside a named `<nav>`. The
* separator is drawn by the stylesheet, so it is never read out and never
* copied with the text; a slash reads the same in either direction.
*/
const props = withDefaults(
defineProps<{
class?: HTMLAttributes["class"]
/** Accessible name of the landmark. */
label?: string
}>(),
{ label: "Breadcrumb" }
)
</script>
<template>
<nav :aria-label="props.label" :class="props.class">
<ol
class="m-0 flex list-none flex-wrap items-center gap-1.5 p-0 text-sm leading-5"
>
<slot />
</ol>
</nav>
</template><script setup lang="ts">
import type { HTMLAttributes } from "vue"
import { cn } from "@/lib/utils"
const props = withDefaults(
defineProps<{
class?: HTMLAttributes["class"]
/** Where this level leads. Omit it to pass a router link in the slot. */
href?: string
/** Marks the page the reader is on; it is text, not a link. */
current?: boolean
}>(),
{ current: false }
)
</script>
<template>
<!-- A router's own link, passed in the slot, is styled from the item. -->
<li
:class="
cn(
'inline-flex min-w-0 items-center gap-1.5 text-newt-text-secondary [&:not(:first-child)]:before:text-newt-text-muted [&:not(:first-child)]:before:content-[\'/\'] [&_a:focus-visible]:outline [&_a:focus-visible]:outline-2 [&_a:focus-visible]:outline-offset-2 [&_a:focus-visible]:outline-newt-text-link [&_a:hover]:text-newt-text-primary [&_a:hover]:underline [&_a]:rounded-[var(--newt-radius-sm)] [&_a]:text-newt-text-secondary [&_a]:no-underline [&_a]:transition-colors [&_a]:duration-fast [&_a]:ease-newt',
props.class
)
"
>
<span
v-if="props.current"
aria-current="page"
class="truncate font-semibold text-newt-text-primary"
>
<slot />
</span>
<a v-else-if="props.href !== undefined" :href="props.href"><slot /></a>
<slot v-else />
</li>
</template>export { default as Breadcrumb } from "./Breadcrumb.vue"
export { default as BreadcrumbItem } from "./BreadcrumbItem.vue"Update the import paths
The files import @/lib/utils and sibling components through the aliases in your components.json. Point them at wherever those live in your project.
No CLI, no components.json: paste this into Claude, Cursor, Copilot or any coding assistant and it adds Breadcrumb to your React project by hand. The prompt carries the source of every file the CLI would write — this component's and those of the components it builds on — with the imports already pointed at the default aliases.
No CLI, no components.json: paste this into Claude, Cursor, Copilot or any coding assistant and it adds Breadcrumb to your Vue project by hand. The prompt carries the source of every file the CLI would write — this component's and those of the components it builds on — with the imports already pointed at the default aliases.
Usage
import { Breadcrumb } from "@/components/ui/breadcrumb"
export function Example() {
return <Breadcrumb />
}<script setup lang="ts">
import { Breadcrumb, BreadcrumbItem } from "@/components/ui/breadcrumb"
</script>
<template>
<Breadcrumb />
</template>API reference
Breadcrumb
label?string
Accessible name of the navigation landmark.
string"Breadcrumb"BreadcrumbItem
href?string
Where this level leads. Omit it and pass your router's link component as the child instead.
stringcurrent?boolean
Marks the page the reader is on. It renders as text, not a link.
booleanfalseA link passed as the child of an item with no href is styled by the item, so a Next.js Link or a NuxtLink looks the same as the built-in anchor.
Accessibility
The trail is an ordered list inside a <nav> named by label, so it appears in a screen reader’s list of landmarks. The last item carries aria-current="page". The slash between items is drawn by the stylesheet and is never read out. Keep the trail short: on a narrow screen it wraps, and the current page truncates before it pushes the layout wide.
label names the trail; it defaults to Breadcrumb. Translating labels lists every English default.
Tokens
Breadcrumb reads its colours, radii and motion from the --newt-* tokens installed with the library. Override a token and every component that reads it follows, including this one — see the token layer. In the plain HTML and CSS distribution the same component is newt-breadcrumb.
--newt-text-muted--newt-radius-sm--newt-text-secondary--newt-duration-fast--newt-ease--newt-text-primary--newt-text-link