{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "list-view",
  "type": "registry:component",
  "title": "List view",
  "description": "Rich rows with avatar, title, meta, timestamp and body, plus a footer link. Based on the MCP Apps for Claude kit.",
  "registryDependencies": [
    "https://mcpblocks.dev/r/host-tokens.json",
    "https://mcpblocks.dev/r/host.json",
    "https://mcpblocks.dev/r/icons.json"
  ],
  "files": [
    {
      "path": "registry/mcpblocks/components/list-view.tsx",
      "content": "import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { guideline } from \"@/registry/mcpblocks/lib/host\"\nimport { ArrowRightIcon } from \"@/registry/mcpblocks/ui/icons\"\n\nexport type ListViewItem = {\n  id: string\n  /** Initials shown in the avatar, e.g. \"SC\". */\n  initials: string\n  /** Avatar background. Any CSS color; defaults to the host info color. */\n  avatarColor?: string\n  title: string\n  /** Secondary label next to the title, e.g. a channel or tag. */\n  meta?: string\n  /** Right-aligned timestamp or status. */\n  timestamp?: string\n  body?: React.ReactNode\n  onClick?: () => void\n}\n\nexport type ListViewProps = React.ComponentProps<\"div\"> & {\n  items: ListViewItem[]\n  /** Footer summary, e.g. \"Showing 4 of 12 results\". */\n  summary?: string\n  /** Footer link to open the full list in your app or in fullscreen. */\n  viewAll?: { label: string; href?: string; onClick?: () => void }\n}\n\n/**\n * A short list of rich rows (messages, tickets, results) for inline display.\n * Matches the \"List views\" pattern in the MCP Apps for Claude kit.\n */\nexport function ListView({ items, summary, viewAll, className, ...props }: ListViewProps) {\n  guideline(items.length > 5, \"ListView: keep inline lists to ~4–5 rows and link to the rest.\")\n\n  return (\n    <div\n      data-slot=\"list-view\"\n      className={cn(\"flex w-full flex-col text-host-fg font-[family-name:var(--font-sans)]\", className)}\n      {...props}\n    >\n      <ul className=\"flex flex-col\">\n        {items.map((item) => {\n          const Row = item.onClick ? \"button\" : \"div\"\n          return (\n            <li key={item.id} className=\"border-b-[length:var(--border-width-regular,0.5px)] border-host-border-secondary\">\n              <Row\n                type={item.onClick ? \"button\" : undefined}\n                onClick={item.onClick}\n                className={cn(\n                  \"flex w-full items-start gap-3 px-6 py-4 text-left\",\n                  item.onClick && \"transition-colors hover:bg-host-bg-tertiary focus-visible:outline-2 focus-visible:outline-host-ring\"\n                )}\n              >\n                <span\n                  aria-hidden=\"true\"\n                  className=\"flex size-8 shrink-0 items-center justify-center rounded-full text-xs leading-[16.8px] font-semibold text-white\"\n                  style={{ backgroundColor: item.avatarColor ?? \"var(--color-text-info)\" }}\n                >\n                  {item.initials}\n                </span>\n                <span className=\"flex min-w-0 flex-1 flex-col gap-1.5\">\n                  <span className=\"flex items-center justify-between gap-3\">\n                    <span className=\"flex min-w-0 items-center gap-2\">\n                      <span className=\"truncate text-sm leading-[19.6px] font-semibold\">{item.title}</span>\n                      {item.meta ? (\n                        <span className=\"truncate text-xs leading-[16.8px] text-host-fg-tertiary opacity-75\">{item.meta}</span>\n                      ) : null}\n                    </span>\n                    {item.timestamp ? (\n                      <span className=\"shrink-0 text-xs leading-[16.8px] text-host-fg-tertiary opacity-75\">{item.timestamp}</span>\n                    ) : null}\n                  </span>\n                  {item.body ? (\n                    <span className=\"line-clamp-2 text-sm leading-[19.6px] text-host-fg-secondary\">{item.body}</span>\n                  ) : null}\n                </span>\n              </Row>\n            </li>\n          )\n        })}\n      </ul>\n\n      {summary || viewAll ? (\n        <div className=\"flex items-center justify-between gap-3 px-4 py-3\">\n          <span className=\"text-xs leading-[16.8px] text-host-fg-tertiary\">{summary}</span>\n          {viewAll ? (\n            <a\n              href={viewAll.href ?? \"#\"}\n              onClick={(e) => {\n                if (viewAll.onClick) {\n                  e.preventDefault()\n                  viewAll.onClick()\n                }\n              }}\n              className=\"inline-flex items-center gap-1 text-xs leading-[16.8px] text-host-info-fg hover:underline\"\n            >\n              {viewAll.label}\n              <ArrowRightIcon className=\"size-4\" />\n            </a>\n          ) : null}\n        </div>\n      ) : null}\n    </div>\n  )\n}\n",
      "type": "registry:component"
    }
  ]
}