{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "The breadcrumbs of an inner page: the parent pages (links where they have an href) separated by chevrons; the last entry is the current page and is not a link.",
  "devDependencies": [],
  "digest": "0.1.0",
  "files": [
    {
      "content": "// Code generated by packages/kit-compose/src/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.\n// Source: packages/compose-gen/specs/organisms/page-crumbs.json\n\npackage blocks\n\nimport (\n\t\"github.com/ui8kit/codegen/generated/templ/ui/box\"\n\t\"github.com/ui8kit/codegen/generated/templ/compose\"\n\t\"github.com/ui8kit/codegen/generated/templ/icons\"\n\t\"github.com/ui8kit/codegen/generated/templ/ui/link\"\n\t\"github.com/ui8kit/codegen/generated/templ/ui/text\"\n\tuiutils \"github.com/ui8kit/codegen/generated/templ/orgutils\"\n)\n\n// PageCrumbsProps are the props of PageCrumbs; the values are the JSON shapes of the TypeScript props.\ntype PageCrumbsProps struct {\n\tLabel any `json:\"label\"`\n\tCrumbs any `json:\"crumbs\"`\n\tLandmarkLabel any `json:\"landmarkLabel\"`\n}\n\n// The breadcrumbs of an inner page: the parent pages (links where they have an href) separated by chevrons; the last entry is the current page and is not a link.\ntempl PageCrumbs(p PageCrumbsProps) {\n\t{{ vLabel := p.Label }}\n\t{{ vCrumbs := p.Crumbs }}\n\t{{ vLandmarkLabel := p.LandmarkLabel }}\n\t{{ vLast := any(uiutils.Sub(uiutils.Len(vCrumbs), float64(1))) }}\n\t@compose.Block(compose.BlockProps{BoxProps: box.BoxProps{Tag: \"nav\", Attrs: uiutils.Attrs(\"aria-label\", uiutils.Coalesce(vLandmarkLabel, vLabel), \"data-slot\", \"crumbs\")}}) {\n\t\t@compose.List(compose.ListProps{BoxProps: box.BoxProps{Class: \"m-0 flex list-none flex-wrap items-center gap-2 p-0 text-sm text-muted-foreground\"}}) {\n\t\t\tfor vI, vC := range uiutils.L(vCrumbs) {\n\t\t\t\t@compose.ListItem(compose.ListItemProps{BoxProps: box.BoxProps{Class: \"flex items-center gap-2\", Attrs: uiutils.Attrs(\"data-slot\", \"crumbs-row\")}}) {\n\t\t\t\t\tif uiutils.Lt(float64(vI), vLast) {\n\t\t\t\t\t\tif uiutils.T(uiutils.Get(vC, \"href\")) {\n\t\t\t\t\t\t\t@compose.Link(compose.LinkProps{Variant: \"muted\", Size: \"sm\", LinkProps: link.LinkProps{Href: uiutils.URL(uiutils.Get(vC, \"href\"), false), Attrs: uiutils.Attrs(\"data-slot\", \"crumb\")}}) {\n\t\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vC, \"name\")) }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Attrs: uiutils.Attrs(\"data-slot\", \"crumb\")}}) {\n\t\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vC, \"name\")) }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@icons.LucideIcon(icons.LucideIconProps{Name: \"chevron-right\", Size: 16})\n\t\t\t\t\t} else {\n\t\t\t\t\t\t@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: \"font-medium text-foreground\", Attrs: uiutils.Attrs(\"aria-current\", \"page\")}}) {\n\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vC, \"name\")) }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n",
      "path": "blocks/page-crumbs.templ",
      "target": "blocks/page-crumbs.templ"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "templ",
      "component"
    ]
  },
  "name": "page-crumbs",
  "registryDependencies": [
    "block",
    "inline",
    "kit-box",
    "kit-link",
    "kit-text",
    "link",
    "list",
    "list-item",
    "lucide-icon",
    "utils"
  ],
  "runtime": "templ",
  "title": "Page Crumbs",
  "type": "registry:component"
}
