{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "dashboard",
  "type": "registry:block",
  "title": "Dashboard block",
  "description": "A deploy dashboard as one screen: an app shell with a full-height sidebar, four number tiles, a chart of deploys per day and a table of recent deploys with its pagination. On a phone the sidebar becomes a top bar and its nav opens in the bottom sheet.",
  "registryDependencies": [
    "https://littmd.vercel.app/r/litt.json",
    "https://littmd.vercel.app/r/app-shell.json",
    "https://littmd.vercel.app/r/chart.json",
    "https://littmd.vercel.app/r/framed.json",
    "https://littmd.vercel.app/r/pagination.json",
    "https://littmd.vercel.app/r/stat.json",
    "https://littmd.vercel.app/r/table.json",
    "https://littmd.vercel.app/r/tag.json"
  ],
  "files": [
    {
      "path": "registry/litt/components/litt-blocks/dashboard.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n// @litt/dashboard 2026.11.03. What changed: https://littmd.vercel.app/changelog.md\n\n/**\n * Dashboard: a deploy dashboard, built from the parts. A block: a whole screen built from the litt parts, to copy and\n * make your own. Swap the sample data and the links at the top for yours; the layout and the words around them stay.\n *\n * An app shell with a full-height sidebar, four number tiles, a chart of deploys per day, and a table of recent deploys\n * with its pagination. On a phone the sidebar becomes a top bar and the nav opens in the bottom sheet. One accent fill\n * in the view would be a primary button, and this view has none.\n */\nimport { useId, useState, type ReactNode } from \"react\";\nimport { AppShell, SidebarLink, SidebarNav } from \"../litt/app-shell\";\nimport { BarChart } from \"../litt/chart\";\nimport { Pagination } from \"../litt/pagination\";\nimport { Stat, StatGroup } from \"../litt/stat\";\nimport { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from \"../litt/table\";\nimport { Tag, type TagStatus } from \"../litt/tag\";\nimport { Heading } from \"../litt/framed\";\n\nconst DAYS = [\"3 Oct\", \"4 Oct\", \"5 Oct\", \"6 Oct\", \"7 Oct\", \"8 Oct\", \"9 Oct\", \"10 Oct\", \"11 Oct\", \"12 Oct\", \"13 Oct\", \"14 Oct\", \"15 Oct\", \"16 Oct\"];\nconst PER_DAY = [5, 7, 4, 9, 6, 1, 0, 6, 8, 5, 9, 7, 2, 1];\n\ntype Status = \"ready\" | \"building\" | \"failed\";\ntype Deploy = { project: string; branch: string; status: Status; time: string };\nconst TONE: Record<Status, TagStatus> = { ready: \"success\", building: \"neutral\", failed: \"danger\" };\n\nconst FIRST_PAGE: Deploy[] = [\n  { project: \"Halo site\", branch: \"main\", status: \"ready\", time: \"2 min ago\" },\n  { project: \"Northwind rebrand\", branch: \"redesign/nav\", status: \"building\", time: \"9 min ago\" },\n  { project: \"Atlas portfolio\", branch: \"main\", status: \"ready\", time: \"1 hour ago\" },\n  { project: \"Lumen docs\", branch: \"fix/search\", status: \"failed\", time: \"3 hours ago\" },\n  { project: \"Kassa pitch deck\", branch: \"main\", status: \"ready\", time: \"yesterday\" },\n  { project: \"Case study template\", branch: \"content/q4\", status: \"ready\", time: \"2 days ago\" },\n];\n\n/** The rest of the history, so the pager has pages to go to. Older rows are all ready except one. */\nconst EARLIER: Deploy[] = Array.from({ length: 18 }, (_, i) => ({\n  project: FIRST_PAGE[(i + 2) % 6]!.project,\n  branch: FIRST_PAGE[(i + 2) % 6]!.branch,\n  status: i === 7 ? \"failed\" : \"ready\",\n  time: i < 4 ? `${i + 3} days ago` : `${i - 1} weeks ago`,\n}));\nconst DEPLOYS = [...FIRST_PAGE, ...EARLIER];\nconst PAGE_SIZE = 6;\n\nfunction Section({ title, note, children }: { title: string; note: string; children: ReactNode }) {\n  const id = useId();\n  return (\n    <section aria-labelledby={id} className=\"grid grid-cols-1 gap-4\">\n      <div className=\"grid gap-1\">\n        <Heading level={2} id={id} className=\"text-litt-body text-litt-fg\">\n          {title}\n        </Heading>\n        <p className=\"text-litt-small text-litt-fg-subtle\">{note}</p>\n      </div>\n      {children}\n    </section>\n  );\n}\n\n/** The links in the sidebar. Point them at your own routes. */\nconst NAV = [\n  { label: \"Overview\", href: \"/\", current: true },\n  { label: \"Projects\", href: \"/projects\" },\n  { label: \"Clients\", href: \"/clients\" },\n  { label: \"Settings\", href: \"/settings\" },\n];\n\nexport type DashboardProps = {\n  /** Starts every landmark's name (\"Studio navigation\", \"Studio recent deploys\"). Change it when two dashboards share a page. */\n  label?: string;\n  /** The window's height, passed to AppShell. Set it when the dashboard sits in a box shorter than the viewport. */\n  viewportHeight?: string;\n};\n\nexport function Dashboard({ label = \"Studio\", viewportHeight }: DashboardProps) {\n  const [page, setPage] = useState(1);\n  const rows = DEPLOYS.slice((page - 1) * PAGE_SIZE, page * PAGE_SIZE);\n  return (\n    <AppShell\n      viewportHeight={viewportHeight}\n      wordmark={<a href=\"/\">litt.design</a>}\n      nav={\n        <SidebarNav label={`${label} navigation`}>\n          {NAV.map((l) => (\n            <SidebarLink key={l.href} href={l.href} current={l.current}>\n              {l.label}\n            </SidebarLink>\n          ))}\n        </SidebarNav>\n      }\n    >\n      <div className=\"@container grid grid-cols-1 gap-8\">\n        <Heading level={1} className=\"text-litt-h3 text-litt-fg\">Overview</Heading>\n\n        <StatGroup>\n          <Stat label=\"Active projects\" value={12} delta=\"Up 2 on last month\" tone=\"good\" />\n          <Stat label=\"Deploys this week\" value={38} delta=\"Up 12% on last week\" tone=\"good\" />\n          <Stat label=\"Median build\" value={41} unit=\"s\" delta=\"Down 6 s on last week\" tone=\"good\" />\n          <Stat label=\"Uptime\" value=\"99.98\" unit=\"%\" delta=\"Same as last month\" />\n        </StatGroup>\n\n        <Section title=\"Deploys per day\" note=\"The last 14 days, oldest first. Today is the full-strength bar.\">\n          <div className=\"litt-raised rounded-litt-surface p-4 @min-[36rem]:p-6\">\n            <BarChart\n              label=\"Deploys per day, last 14 days\"\n              labels={DAYS}\n              series={[{ name: \"Deploys\", values: PER_DAY }]}\n              unit={[\"deploy\", \"deploys\"]}\n              xTitle=\"Day\"\n              height={220}\n            />\n          </div>\n        </Section>\n\n        <Section title=\"Recent deploys\" note=\"Every build on every branch, newest first.\">\n          <div>\n            <Table label={`${label} recent deploys`}>\n              <TableHeader>\n                <TableRow>\n                  <TableHead>Project</TableHead>\n                  <TableHead>Branch</TableHead>\n                  <TableHead>Status</TableHead>\n                  <TableHead numeric>Time</TableHead>\n                </TableRow>\n              </TableHeader>\n              <TableBody>\n                {rows.map((d) => (\n                  <TableRow key={`${page}-${d.project}-${d.time}`}>\n                    <TableCell primary>{d.project}</TableCell>\n                    <TableCell>{d.branch}</TableCell>\n                    <TableCell>\n                      <Tag status={TONE[d.status]}>{d.status}</Tag>\n                    </TableCell>\n                    <TableCell numeric>{d.time}</TableCell>\n                  </TableRow>\n                ))}\n              </TableBody>\n            </Table>\n            <Pagination className=\"mt-4\" label={`${label} deploys pages`} page={page} pageSize={PAGE_SIZE} total={DEPLOYS.length} onPageChange={setPage} />\n          </div>\n        </Section>\n      </div>\n    </AppShell>\n  );\n}\n",
      "target": "components/litt-blocks/dashboard.tsx"
    }
  ],
  "docs": "Import Dashboard from components/litt-blocks/dashboard and render it as a whole page. The sample deploys and the sidebar links sit at the top of the file: replace them with your data and your routes. See it live at https://littmd.vercel.app/#dashboard.",
  "meta": {
    "version": "2026.11.03",
    "released": "2026-11-03",
    "changelog": "https://littmd.vercel.app/changelog.md"
  }
}
