Breadcrumb
scificn/breadcrumbFreeComponent
Navigation breadcrumb trail showing current location hierarchy.
Live preview
live · rendered by the registry
Rendered by scificn on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.scificn.dev/r/breadcrumb.jsonSource
1import * as React from 'react'2import { cn } from '@/lib/utils'34const Breadcrumb = React.forwardRef<5 HTMLElement,6 React.ComponentPropsWithoutRef<'nav'> & { separator?: React.ReactNode }7>(({ ...props }, ref) => <nav ref={ref} aria-label="breadcrumb" {...props} />)8Breadcrumb.displayName = 'Breadcrumb'910const BreadcrumbList = React.forwardRef<11 HTMLOListElement,12 React.ComponentPropsWithoutRef<'ol'>13>(({ className, ...props }, ref) => (14 <ol15 ref={ref}16 className={cn(17 'flex flex-wrap items-center gap-1.5',18 'font-mono text-xs text-[var(--text-muted)]',19 'uppercase tracking-wider',20 className21 )}22 {...props}23 />24))25BreadcrumbList.displayName = 'BreadcrumbList'2627const BreadcrumbItem = React.forwardRef<28 HTMLLIElement,29 React.ComponentPropsWithoutRef<'li'>30>(({ className, ...props }, ref) => (31 <li ref={ref} className={cn('inline-flex items-center gap-1.5', className)} {...props} />32))33BreadcrumbItem.displayName = 'BreadcrumbItem'3435const BreadcrumbLink = React.forwardRef<36 HTMLAnchorElement,37 React.ComponentPropsWithoutRef<'a'>38>(({ className, ...props }, ref) => (39 <a40 ref={ref}41 className={cn(42 'text-[var(--text-muted)] hover:text-[var(--color-green)]',43 'transition-colors duration-150',44 className45 )}46 {...props}47 />48))49BreadcrumbLink.displayName = 'BreadcrumbLink'5051const BreadcrumbPage = React.forwardRef<52 HTMLSpanElement,53 React.ComponentPropsWithoutRef<'span'>54>(({ className, ...props }, ref) => (55 <span56 ref={ref}57 role="link"58 aria-disabled="true"59 aria-current="page"60 className={cn('text-[var(--color-green)]', className)}61 {...props}62 />63))64BreadcrumbPage.displayName = 'BreadcrumbPage'6566const BreadcrumbSeparator = ({67 children,68 className,69 ...props70}: React.ComponentProps<'li'>) => (71 <li72 role="presentation"73 aria-hidden="true"74 className={cn('text-[var(--border-active)]', className)}75 {...props}76 >77 {children ?? '>'}78 </li>79)80BreadcrumbSeparator.displayName = 'BreadcrumbSeparator'8182export {83 Breadcrumb,84 BreadcrumbList,85 BreadcrumbItem,86 BreadcrumbLink,87 BreadcrumbPage,88 BreadcrumbSeparator,89}
More from scificn
All 33 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Alertalert | scificn | Components | Free | 1 dep | |
| Badgebadge | scificn | Components | Free | 1 dep | |
| Bar Chartbar-chart | scificn | Components | Free | no deps | |
| Buttonbutton | scificn | Components | Free | 2 deps | |
| Cardcard | scificn | Components | Free | no deps | |
| Checkboxcheckbox | scificn | Components | Free | 1 dep | |
| Dialogdialog | scificn | Components | Free | 1 dep | |
| Gridgrid | scificn | Components | Free | no deps |
