{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "dot-rail-demo",
  "type": "registry:block",
  "title": "Dot Rail: Feature Tabs",
  "description": "LED Dot Tab Indicator example, Feature Tabs: An AI note-taker's four features as tabs that play by themselves. The dots under the current tab count up like a timer, the rail jumps to any tab you point at, and picking one stops the autoplay. A take on the tabs (tab bar) and progress bar (loading bar). Fits features, navbar, changelog and hero sections.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "features",
    "navbar",
    "changelog",
    "hero",
    "tabs",
    "progress-bar",
    "navigation",
    "progress",
    "canvas"
  ],
  "docs": "Live preview, examples and props: https://keyframeui.com/components/dot-rail#dot-rail-demo",
  "registryDependencies": [
    "https://keyframeui.com/r/dot-rail.json"
  ],
  "files": [
    {
      "path": "components/dot-rail-demo.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { useInView, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@/lib/utils\";\nimport { DotRail } from \"@/components/ui/dot-rail\";\n\nconst DWELL = 5000; // ms each feature stays up while it plays by itself\nconst TICK = 80; // ms between steps of the timer under the current tab\n\ntype Feature = { id: string; label: string; title: string; body: string; view: React.ReactNode };\n\n// Minutes, an AI note-taker: four things it does after a call, one per tab.\nconst FEATURES: Feature[] = [\n  {\n    id: \"record\",\n    label: \"Record\",\n    title: \"It joins the call so nobody has to type\",\n    body: \"Minutes sits in on Zoom, Meet and Teams, and tells everyone it's there.\",\n    view: <RecordView />,\n  },\n  {\n    id: \"summarize\",\n    label: \"Summarize\",\n    title: \"The decisions, not the transcript\",\n    body: \"Thirty minutes of talk comes back as five lines, with links to the moments behind them.\",\n    view: <SummaryView />,\n  },\n  {\n    id: \"assign\",\n    label: \"Assign\",\n    title: \"Every promise gets an owner\",\n    body: \"“I'll send that over” becomes a task with a name and a date on it.\",\n    view: <TasksView />,\n  },\n  {\n    id: \"follow-up\",\n    label: \"Follow up\",\n    title: \"The recap is written before you're back at your desk\",\n    body: \"Review it, change a word, and send it to everyone who was there.\",\n    view: <RecapView />,\n  },\n];\n\nexport function DotRailDemo() {\n  const rootRef = React.useRef<HTMLDivElement>(null);\n  const tabsRef = React.useRef<HTMLDivElement>(null);\n  const inView = useInView(rootRef, { amount: 0.4 });\n  const reduced = useReducedMotion();\n  const [clock, setClock] = React.useState({ active: 0, elapsed: 0 });\n  const [auto, setAuto] = React.useState(true);\n  const [paused, setPaused] = React.useState(false);\n\n  const playing = auto && !paused && inView && !reduced;\n  React.useEffect(() => {\n    if (!playing) return;\n    const id = window.setInterval(() => {\n      setClock(({ active, elapsed }) =>\n        elapsed + TICK >= DWELL\n          ? { active: (active + 1) % FEATURES.length, elapsed: 0 }\n          : { active, elapsed: elapsed + TICK },\n      );\n    }, TICK);\n    return () => window.clearInterval(id);\n  }, [playing]);\n\n  const pick = (index: number) => {\n    setAuto(false);\n    setClock({ active: index, elapsed: 0 });\n  };\n\n  const onKey = (e: React.KeyboardEvent<HTMLButtonElement>, index: number) => {\n    const n = FEATURES.length;\n    const to =\n      e.key === \"ArrowRight\" ? (index + 1) % n : e.key === \"ArrowLeft\" ? (index - 1 + n) % n : e.key === \"Home\" ? 0 : e.key === \"End\" ? n - 1 : -1;\n    if (to < 0) return;\n    e.preventDefault();\n    pick(to);\n    tabsRef.current?.querySelectorAll<HTMLButtonElement>('[role=\"tab\"]')[to]?.focus();\n  };\n\n  const { active, elapsed } = clock;\n\n  return (\n    <div\n      ref={rootRef}\n      onPointerEnter={(e) => e.pointerType === \"mouse\" && setPaused(true)}\n      onPointerLeave={(e) => e.pointerType === \"mouse\" && setPaused(false)}\n      className=\"@container w-full max-w-4xl rounded-2xl border border-zinc-950/10 bg-[#fafaf9] p-5 text-zinc-950 [--dot-rail-accent:#ff5a1f] @[40rem]:p-8 dark:border-white/10 dark:bg-[#07080c] dark:text-zinc-100 dark:[--dot-rail-accent:#ff6a2b]\"\n    >\n      <h2 className=\"max-w-lg font-serif text-3xl leading-[1.05] tracking-[-0.02em] text-balance @[40rem]:text-[2.6rem]\">\n        Meetings that <em className=\"text-[#2747ff] dark:text-[#8292ff]\">finish</em> themselves\n      </h2>\n\n      <div ref={tabsRef} role=\"tablist\" aria-label=\"What Minutes does\" className=\"mt-8 grid grid-cols-4\">\n        {FEATURES.map((feature, index) => (\n          <button\n            key={feature.id}\n            id={`minutes-tab-${feature.id}`}\n            type=\"button\"\n            role=\"tab\"\n            aria-selected={index === active}\n            aria-controls={`minutes-panel-${feature.id}`}\n            tabIndex={index === active ? 0 : -1}\n            onClick={() => pick(index)}\n            onKeyDown={(e) => onKey(e, index)}\n            className=\"rounded-md px-1 pb-2.5 text-left text-[13px] font-medium text-zinc-400 transition-colors duration-150 outline-none hover:text-zinc-950 focus-visible:text-zinc-950 focus-visible:underline focus-visible:decoration-[#ff5a1f] focus-visible:underline-offset-4 aria-selected:text-zinc-950 @[40rem]:text-sm dark:text-zinc-500 dark:hover:text-zinc-100 dark:focus-visible:text-zinc-100 dark:aria-selected:text-zinc-100\"\n          >\n            {feature.label}\n          </button>\n        ))}\n      </div>\n      <DotRail trackRef={tabsRef} fill={auto && !reduced ? elapsed / DWELL : 1} />\n\n      <div className=\"mt-6 grid\">\n        {FEATURES.map((feature, index) => (\n          <section\n            key={feature.id}\n            id={`minutes-panel-${feature.id}`}\n            role=\"tabpanel\"\n            aria-labelledby={`minutes-tab-${feature.id}`}\n            inert={index !== active}\n            className={cn(\n              \"col-start-1 row-start-1 grid gap-6 transition-[opacity,translate] duration-200 ease-[cubic-bezier(0.23,1,0.32,1)] motion-reduce:translate-y-0 @[40rem]:grid-cols-[minmax(0,1fr)_minmax(0,1.15fr)] @[40rem]:items-center @[40rem]:gap-10\",\n              index === active ? \"translate-y-0 opacity-100\" : \"pointer-events-none translate-y-1.5 opacity-0\",\n            )}\n          >\n            <div>\n              <h3 className=\"text-lg leading-snug font-semibold tracking-[-0.01em] text-balance\">{feature.title}</h3>\n              <p className=\"mt-2 text-sm leading-relaxed text-zinc-600 dark:text-zinc-400\">{feature.body}</p>\n            </div>\n            {feature.view}\n          </section>\n        ))}\n      </div>\n    </div>\n  );\n}\n\n/* ── The product, one view per tab ───────────────────────── */\n\nfunction Card({ children, className }: { children: React.ReactNode; className?: string }) {\n  return (\n    <div\n      className={cn(\n        \"rounded-xl bg-white p-4 shadow-sm ring-1 ring-zinc-950/[0.06] dark:bg-zinc-900/70 dark:shadow-none dark:ring-white/[0.08]\",\n        className,\n      )}\n    >\n      {children}\n    </div>\n  );\n}\n\nconst WAVE = [6, 14, 22, 12, 30, 18, 26, 9, 16, 34, 24, 12, 20, 28, 10, 18, 32, 14, 8, 22, 26, 12, 18, 30, 16, 10, 24, 20, 12, 6];\n\nfunction RecordView() {\n  return (\n    <Card>\n      <div className=\"flex items-center justify-between text-xs\">\n        <span className=\"flex items-center gap-1.5 font-medium\">\n          <span className=\"size-1.5 rounded-full bg-[#ff5a1f]\" />\n          Recording · Q4 planning\n        </span>\n        <span className=\"font-mono text-zinc-500 tabular-nums\">24:13</span>\n      </div>\n      <div className=\"mt-4 flex h-9 items-center gap-[3px]\" aria-hidden>\n        {WAVE.map((h, i) => (\n          <span key={i} className=\"w-full rounded-full bg-zinc-950/80 dark:bg-zinc-100/80\" style={{ height: h }} />\n        ))}\n      </div>\n      <div className=\"mt-4 flex items-center gap-2 text-xs text-zinc-500\">\n        <div className=\"flex -space-x-1\">\n          {[\"A\", \"T\", \"M\", \"J\"].map((who) => (\n            <span\n              key={who}\n              className=\"grid size-6 place-items-center rounded-full bg-zinc-200 text-[10px] font-semibold text-zinc-700 ring-2 ring-white dark:bg-zinc-700 dark:text-zinc-200 dark:ring-zinc-900\"\n            >\n              {who}\n            </span>\n          ))}\n        </div>\n        6 people, 2 rooms\n      </div>\n    </Card>\n  );\n}\n\nfunction SummaryView() {\n  const lines = [\n    \"Ship the export redesign on Nov 18, not Dec 2.\",\n    \"Pricing stays as is until the January review.\",\n    \"Support hires two more people in Lisbon.\",\n  ];\n  return (\n    <Card>\n      <p className=\"text-xs font-medium text-zinc-500\">Summary · 3 decisions</p>\n      <ul className=\"mt-3 space-y-2.5 text-[13px] leading-snug\">\n        {lines.map((line, i) => (\n          <li key={line} className=\"flex gap-2.5\">\n            <span className=\"mt-[7px] size-1 shrink-0 rounded-full bg-current\" />\n            <span>\n              {line}{\" \"}\n              <span className=\"font-mono text-[11px] text-[#2747ff] tabular-nums dark:text-[#8292ff]\">\n                {[\"04:12\", \"11:40\", \"19:05\"][i]}\n              </span>\n            </span>\n          </li>\n        ))}\n      </ul>\n    </Card>\n  );\n}\n\nfunction TasksView() {\n  const tasks = [\n    { what: \"Send the export spec to design\", who: \"Ana\", due: \"Thu\" },\n    { what: \"Draft the January pricing memo\", who: \"Theo\", due: \"Nov 29\" },\n    { what: \"Open two Lisbon support roles\", who: \"Mika\", due: \"Mon\" },\n  ];\n  return (\n    <Card className=\"p-0\">\n      <ul className=\"divide-y divide-zinc-950/[0.06] text-[13px] dark:divide-white/[0.06]\">\n        {tasks.map((task) => (\n          <li key={task.what} className=\"flex items-center gap-3 px-4 py-3\">\n            <span className=\"size-3.5 shrink-0 rounded-[4px] ring-1 ring-zinc-950/25 dark:ring-white/30\" />\n            <span className=\"min-w-0 flex-1 truncate\">{task.what}</span>\n            <span className=\"rounded-full bg-zinc-100 px-2 py-0.5 text-[11px] font-medium dark:bg-white/10\">{task.who}</span>\n            <span className=\"w-12 text-right font-mono text-[11px] text-zinc-500 tabular-nums\">{task.due}</span>\n          </li>\n        ))}\n      </ul>\n    </Card>\n  );\n}\n\nfunction RecapView() {\n  return (\n    <Card>\n      <div className=\"space-y-1 text-xs text-zinc-500\">\n        <p>\n          To <span className=\"text-zinc-950 dark:text-zinc-100\">6 people from Q4 planning</span>\n        </p>\n        <p>\n          Subject <span className=\"text-zinc-950 dark:text-zinc-100\">Recap: export date, pricing, Lisbon</span>\n        </p>\n      </div>\n      <p className=\"mt-3 border-t border-zinc-950/[0.06] pt-3 text-[13px] leading-relaxed dark:border-white/[0.06]\">\n        Thanks all. We moved the export redesign up to Nov 18 and kept pricing as is until January. Three owners below.\n      </p>\n      <div className=\"mt-4 flex items-center justify-between\">\n        <span className=\"text-[11px] text-zinc-500\">Drafted 2 min after the call</span>\n        <span className=\"rounded-full bg-zinc-950 px-3 py-1.5 text-xs font-medium text-white dark:bg-zinc-100 dark:text-zinc-950\">\n          Send recap\n        </span>\n      </div>\n    </Card>\n  );\n}\n"
    }
  ]
}