Breadcrumb
weekendsuperhero-io-sistine/breadcrumbUnverifiedComponent
Displays the path to the current resource using a hierarchy of links.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/Weekendsuperhero-io/sistine/main/breadcrumb.jsonSource
1import { ArrowsHorizontalIcon, CaretRightIcon } from "@phosphor-icons/react";2import { Slot as SlotPrimitive } from "radix-ui";3import * as React from "react";45import { type MaterialAxisProps, materialSurface, splitAxisProps } from "@/lib/material";6import { cn } from "@/lib/utils";78const Breadcrumb = React.forwardRef<9 HTMLElement,10 React.ComponentPropsWithoutRef<"nav"> & {11 separator?: React.ComponentType<{12 className?: string;13 }>;14 }15>(({ ...props }, ref) => <nav ref={ref} aria-label="breadcrumb" data-slot="breadcrumb" {...props} />);16Breadcrumb.displayName = "Breadcrumb";1718/* Role: bordered adaptive glass. */19const ROLE = {20 border: true,21};2223const BreadcrumbList = React.forwardRef<24 HTMLOListElement,25 React.ComponentPropsWithoutRef<"ol"> &26 MaterialAxisProps & {27 variant?: "default" | "glass";28 }29>(({ className, variant = "glass", ...props }, ref) => {30 const [axes, rest] = splitAxisProps(props);31 /* Variant classes carry BEHAVIOR only; the surface comes from materialSurface. */32 const variants = {33 default: "",34 glass: "rounded-lg px-4 py-2",35 };3637 const m = materialSurface(variant === "default" ? null : ROLE, axes);3839 return (40 <ol41 ref={ref}42 data-slot="breadcrumb-list"43 data-material={m?.["data-material"]}44 className={cn(45 m?.className,46 "flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",47 variants[variant],48 className,49 )}50 {...rest}51 />52 );53});54BreadcrumbList.displayName = "BreadcrumbList";5556const BreadcrumbItem = React.forwardRef<HTMLLIElement, React.ComponentPropsWithoutRef<"li">>(({ className, ...props }, ref) => (57 <li ref={ref} data-slot="breadcrumb-item" className={cn("inline-flex items-center gap-1.5", className)} {...props} />58));59BreadcrumbItem.displayName = "BreadcrumbItem";6061const BreadcrumbLink = React.forwardRef<62 HTMLAnchorElement,63 React.ComponentPropsWithoutRef<"a"> & {64 asChild?: boolean;65 }66>(({ asChild, className, ...props }, ref) => {67 const Comp = asChild ? SlotPrimitive.Slot : "a";68 return <Comp ref={ref} data-slot="breadcrumb-link" className={cn("transition-colors hover:text-foreground", className)} {...props} />;69});70BreadcrumbLink.displayName = "BreadcrumbLink";7172const BreadcrumbPage = React.forwardRef<HTMLSpanElement, React.ComponentPropsWithoutRef<"span">>(({ className, ...props }, ref) => (73 <span74 ref={ref}75 data-slot="breadcrumb-page"76 role="link"77// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from weekendsuperhero-io/sistine
All 71 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | weekendsuperhero-io/sistine | Components | Unverified | 5 deps · 4 files | |
| Alertalert | weekendsuperhero-io/sistine | Components | Unverified | 3 deps · 4 files | |
| Alert Dialogalert-dialog | weekendsuperhero-io/sistine | Components | Unverified | 4 deps · 4 files | |
| Auto Foregroundauto-foreground | weekendsuperhero-io/sistine | Components | Unverified | no deps | |
| Avataravatar | weekendsuperhero-io/sistine | Components | Unverified | 4 deps · 4 files | |
| Badgebadge | weekendsuperhero-io/sistine | Components | Unverified | 4 deps · 4 files | |
| Buttonbutton | weekendsuperhero-io/sistine | Components | Unverified | 4 deps · 4 files | |
| Button Groupbutton-group | weekendsuperhero-io/sistine | Components | Unverified | 4 deps · 4 files |
