{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "margin-note-revenue-demo",
  "type": "registry:block",
  "title": "Margin Note: Year Against Year",
  "description": "Annotated Line Chart example, Year Against Year: Monthly revenue against last year's, dashed underneath, with notes on annual plans, a team tier and a record December. A take on the chart (graph). Fits stats and app UI sections.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "stats",
    "app-ui",
    "chart",
    "annotation",
    "data",
    "ai"
  ],
  "docs": "Live preview, examples and props: https://keyframeui.com/components/margin-note#margin-note-revenue-demo",
  "registryDependencies": [
    "https://keyframeui.com/r/margin-note.json"
  ],
  "files": [
    {
      "path": "components/margin-note-revenue-demo.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport { MarginNote, type MarginNoteNote } from \"@/components/ui/margin-note\";\n\nconst MONTHS = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\nconst THIS_YEAR = [42, 45, 58, 61, 63, 79, 86, 91, 88, 94, 102, 131];\nconst LAST_YEAR = [38, 39, 41, 43, 44, 46, 47, 49, 48, 52, 55, 70];\n\nconst NOTES: MarginNoteNote[] = [\n  { at: 2, title: \"Annual plans\", body: \"Two months free on yearly billing.\", delta: \"+29%\" },\n  { at: 5, to: 7, title: \"Team tier\", body: \"Studios moved up; the average order rose to $212.\", delta: \"+25%\" },\n  { at: 11, title: \"Gift cards\", body: \"The best December yet, 1.9× last year's.\", delta: \"+87%\" },\n];\n\nexport function MarginNoteRevenueDemo() {\n  const [run, setRun] = React.useState(0);\n  return (\n    <div className=\"w-full max-w-3xl rounded-2xl bg-stone-50 p-5 text-stone-900 ring-1 ring-stone-950/[0.08] sm:p-7 dark:bg-stone-900 dark:text-stone-100 dark:ring-white/10\">\n      <div className=\"mb-5 flex flex-wrap items-end justify-between gap-x-6 gap-y-3\">\n        <div>\n          <p className=\"text-xs font-medium text-stone-500 dark:text-stone-400\">Tinta · Revenue by month</p>\n          <p className=\"mt-1 flex items-baseline gap-2\">\n            <span className=\"text-2xl font-semibold tracking-tight tabular-nums\">$940k</span>\n            <span className=\"text-xs font-medium text-emerald-700 tabular-nums dark:text-emerald-400\">+64% on 2024</span>\n          </p>\n        </div>\n        <div className=\"flex items-center gap-4 text-xs text-stone-500 dark:text-stone-400\">\n          <span className=\"flex items-center gap-1.5\">\n            <svg width=\"16\" height=\"2\" aria-hidden>\n              <line x1=\"0\" y1=\"1\" x2=\"16\" y2=\"1\" stroke=\"currentColor\" strokeWidth=\"1.5\" className=\"text-stone-900 dark:text-stone-100\" />\n            </svg>\n            2025\n          </span>\n          <span className=\"flex items-center gap-1.5\">\n            <svg width=\"16\" height=\"2\" aria-hidden>\n              <line x1=\"0\" y1=\"1\" x2=\"16\" y2=\"1\" stroke=\"currentColor\" strokeWidth=\"1.25\" strokeDasharray=\"3 4\" opacity=\"0.6\" />\n            </svg>\n            2024\n          </span>\n          <button\n            type=\"button\"\n            onClick={() => setRun((r) => r + 1)}\n            className=\"rounded-full px-2.5 py-1 font-medium text-stone-600 ring-1 ring-stone-950/10 transition-colors hover:bg-white hover:text-stone-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-stone-900 dark:text-stone-300 dark:ring-white/15 dark:hover:bg-white/5 dark:hover:text-white dark:focus-visible:outline-white\"\n          >\n            Read again\n          </button>\n        </div>\n      </div>\n      <MarginNote\n        key={run}\n        label=\"Tinta monthly revenue, 2025 against 2024\"\n        data={THIS_YEAR}\n        compare={LAST_YEAR}\n        labels={MONTHS}\n        notes={NOTES}\n        summary=\"2025 closed 64% ahead of 2024, most of it after the team tier.\"\n        format={(value) => (value === 0 ? \"$0\" : `$${value}k`)}\n        className=\"[--margin-note-accent:#047857] dark:[--margin-note-accent:#34d399]\"\n      />\n    </div>\n  );\n}\n"
    }
  ]
}