breadcrumb
shadcn-solidjs/breadcrumbFreeComponent
shadcn-solidjs publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by shadcn-solidjs on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://shadcn-solidjs.com/r/breadcrumb.jsonSource
1import type { PolymorphicProps } from "@kobalte/core/polymorphic";2import { Polymorphic } from "@kobalte/core/polymorphic";34import { cn } from "~/lib/utils.ts";5import IconChevronRight from "~icons/lucide/chevron-right";6import IconEllipsis from "~icons/lucide/ellipsis";78import type { Component, ComponentProps, ValidComponent } from "solid-js";9import { children, Show, splitProps } from "solid-js";1011const Breadcrumb: Component<ComponentProps<"nav">> = (props) => {12 const [local, others] = splitProps(props, ["class"]);13 return (14 <nav15 aria-label="breadcrumb"16 data-slot="breadcrumb"17 class={cn(local.class)}18 {...others}19 />20 );21};2223const BreadcrumbList: Component<ComponentProps<"ol">> = (props) => {24 const [local, others] = splitProps(props, ["class"]);25 return (26 <ol27 data-slot="breadcrumb-list"28 class={cn(29 "text-muted-foreground gap-1.5 text-sm wrap-break-word flex flex-wrap items-center",30 local.class,31 )}32 {...others}33 />34 );35};3637const BreadcrumbItem: Component<ComponentProps<"li">> = (props) => {38 const [local, others] = splitProps(props, ["class"]);39 return (40 <li41 data-slot="breadcrumb-item"42 class={cn("gap-1 inline-flex items-center", local.class)}43 {...others}44 />45 );46};4748type BreadcrumbLinkProps<T extends ValidComponent = "a"> =49 & ComponentProps<"a">50 & { class?: string | undefined };5152const BreadcrumbLink = <T extends ValidComponent = "a">(53 props: PolymorphicProps<T, BreadcrumbLinkProps<T>>,54) => {55 const [local, others] = splitProps(props as BreadcrumbLinkProps, ["class"]);56 return (57 <Polymorphic58 as="a"59 data-slot="breadcrumb-link"60 class={cn("hover:text-foreground transition-colors", local.class)}61 {...others}62 />63 );64};6566const BreadcrumbPage: Component<ComponentProps<"span">> = (props) => {67 const [local, others] = splitProps(props, ["class"]);68 return (69 <span70 data-slot="breadcrumb-page"71 role="link"72 aria-disabled="true"73 aria-current="page"74 class={cn("text-foreground font-normal", local.class)}75 {...others}76 />77 );78};7980const BreadcrumbSeparator: Component<ComponentProps<"li">> = (props) => {81 const [local, others] = splitProps(props, ["class", "children"]);8283 // prevents rendering children twice84 const resolvedChildren = children(() => local.children);85 const hasChildren = () => resolvedChildren.toArray().length !== 0;8687 return (88 <li89// … truncated
What it pulls in
npm packages
More from shadcn-solidjs
All 85 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | shadcn-solidjs | Components | Free | 1 dep | |
| alertalert | shadcn-solidjs | Components | Free | 2 deps | |
| alert-dialogalert-dialog | shadcn-solidjs | Components | Free | 2 deps | |
| aspect-ratioaspect-ratio | shadcn-solidjs | Components | Free | no deps | |
| attachmentattachment | shadcn-solidjs | Components | Free | 2 deps | |
| avataravatar | shadcn-solidjs | Components | Free | 1 dep | |
| badgebadge | shadcn-solidjs | Components | Free | 2 deps | |
| bubblebubble | shadcn-solidjs | Components | Free | 2 deps |
