{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"striped-comparison-table-with-sticky-header","type":"registry:block","title":"Striped Comparison Table With Sticky Header","description":"","dependencies":[],"files":[{"path":"components/we-inc/striped-comparison-table-with-sticky-header.tsx","type":"registry:component","content":"// A striped plan comparison inside a scrolling box: the header row sticks while you scroll.\nconst plans = [\"Commuter\", \"Tourer\", \"Cargo\"];\nconst rows: [string, (string | boolean)[]][] = [\n  [\"Range on one charge\", [\"60 km\", \"110 km\", \"85 km\"]],\n  [\"Motor\", [\"250 W hub\", \"250 W mid-drive\", \"250 W mid-drive\"]],\n  [\"Weight\", [\"19 kg\", \"23 kg\", \"34 kg\"]],\n  [\"Gears\", [\"Single speed\", \"Belt hub, 8\", \"Belt hub, 5\"]],\n  [\"Integrated lights\", [true, true, true]],\n  [\"Rear rack\", [false, true, true]],\n  [\"Front cargo box\", [false, false, true]],\n  [\"Suspension fork\", [false, true, false]],\n  [\"Hydraulic disc brakes\", [true, true, true]],\n  [\"App lock and tracking\", [false, true, true]],\n  [\"Max rider and load\", [\"120 kg\", \"130 kg\", \"200 kg\"]],\n  [\"Warranty\", [\"2 years\", \"3 years\", \"3 years\"]],\n  [\"Price\", [\"£1,290\", \"£2,450\", \"£3,180\"]],\n];\n\nfunction Mark({ on }: { on: boolean }) {\n  return on ? (\n    <span className=\"inline-flex items-center gap-1.5 text-teal-800\"><svg viewBox=\"0 0 16 16\" className=\"h-4 w-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.2\" aria-hidden=\"true\"><path d=\"m3.5 8.5 3 3 6-7\" strokeLinecap=\"round\" strokeLinejoin=\"round\" /></svg><span className=\"sr-only\">Included</span></span>\n  ) : (\n    <span className=\"inline-flex items-center text-slate-400\"><svg viewBox=\"0 0 16 16\" className=\"h-4 w-4\" stroke=\"currentColor\" strokeWidth=\"2\" aria-hidden=\"true\"><path d=\"M4 8h8\" strokeLinecap=\"round\" /></svg><span className=\"sr-only\">Not included</span></span>\n  );\n}\n\nexport default function StripedComparisonTableWithStickyHeader() {\n  return (\n    <section className=\"bg-white px-5 py-14 sm:py-20\">\n      <div className=\"mx-auto max-w-4xl\">\n        <h2 className=\"text-2xl font-semibold tracking-tight text-slate-900 sm:text-3xl\">Compare Velomarsh e-bikes</h2>\n        <p className=\"mt-2 text-[15px] text-slate-600\">Scroll the table; the model names stay at the top.</p>\n        <div className=\"mt-8 max-h-[420px] overflow-auto rounded-xl border border-slate-200\" tabIndex={0} role=\"region\" aria-label=\"E-bike comparison, scrollable\">\n          <table className=\"w-full border-separate border-spacing-0 text-left text-sm\">\n            <caption className=\"sr-only\">Velomarsh e-bike models compared feature by feature</caption>\n            <thead>\n              <tr>\n                <th scope=\"col\" className=\"sticky left-0 top-0 z-20 bg-slate-900 px-3 py-3 sm:px-4.5 font-medium text-slate-300\">Feature</th>\n                {plans.map((p) => (\n                  <th key={p} scope=\"col\" className=\"sticky top-0 z-10 bg-slate-900 px-3 py-3 sm:px-4.5 text-base font-semibold text-white\">{p}</th>\n                ))}\n              </tr>\n            </thead>\n            <tbody>\n              {rows.map(([label, vals], i) => (\n                <tr key={label} className={i % 2 ? \"bg-white\" : \"bg-teal-50/60\"}>\n                  <th scope=\"row\" className={`sticky left-0 z-[1] px-3 py-3 sm:px-4 font-medium text-slate-900 ${i % 2 ? \"bg-white\" : \"bg-[#f3faf9]\"}`}>{label}</th>\n                  {vals.map((v, j) => (\n                    <td key={j} className={`px-3 py-3 sm:px-4 ${label === \"Price\" ? \"font-semibold text-slate-900\" : \"text-slate-700\"}`}>\n                      {typeof v === \"boolean\" ? <Mark on={v} /> : v}\n                    </td>\n                  ))}\n                </tr>\n              ))}\n            </tbody>\n          </table>\n        </div>\n      </div>\n    </section>\n  );\n}\n"}]}
