{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "app-shell-multi-column",
  "title": "App Shell, Multi-column Layout",
  "description": "A multi-column application shell: an icon rail for sections with tooltips, a filterable list column, the selected item in the main pane and a details column you can show or hide. Switching sections swaps the list with a stagger, and on phones the list and detail take turns.",
  "dependencies": [
    "motion",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/app-shell-multi-column/app-shell-multi-column.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nfunction cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\nexport interface MultiColumnItem {\n  id: string;\n  title: string;\n  subtitle: string;\n  meta: string;\n  color: string;\n  status?: string;\n  /** Rows shown in the detail aside. */\n  details?: [string, string][];\n}\n\nexport interface MultiColumnSection {\n  id: string;\n  label: string;\n  icon: \"projects\" | \"clients\" | \"docs\" | \"calendar\";\n  items: MultiColumnItem[];\n}\n\nexport interface AppShellMultiColumnProps {\n  sections?: MultiColumnSection[];\n  children?: (item: MultiColumnItem) => React.ReactNode;\n  theme?: \"dark\" | \"light\";\n  className?: string;\n}\n\nconst PALETTES = {\n  dark: { bg: \"#0A0A0A\", text: \"#F5F4F1\", muted: \"rgba(245,244,241,0.62)\", faint: \"rgba(245,244,241,0.36)\", rail: \"#0B0B0B\", list: \"#0F0F0F\", main: \"#131313\", aside: \"#101010\", border: \"rgba(255,255,255,0.08)\", chip: \"rgba(255,255,255,0.06)\", hover: \"rgba(255,255,255,0.04)\", sel: \"rgba(255,255,255,0.07)\", skel: \"rgba(255,255,255,0.045)\", on: \"#F5F4F1\", onText: \"#0A0A0A\", accent: \"#FB923C\", ring: \"rgba(245,244,241,0.6)\", tip: \"#1C1C1C\" },\n  light: { bg: \"#F4F4F1\", text: \"#0A0A0A\", muted: \"rgba(10,10,10,0.62)\", faint: \"rgba(10,10,10,0.4)\", rail: \"#F1F1EE\", list: \"#FAFAF8\", main: \"#FFFFFF\", aside: \"#FAFAF8\", border: \"rgba(10,10,10,0.08)\", chip: \"rgba(10,10,10,0.05)\", hover: \"rgba(10,10,10,0.03)\", sel: \"rgba(10,10,10,0.05)\", skel: \"rgba(10,10,10,0.05)\", on: \"#0A0A0A\", onText: \"#FAFAF8\", accent: \"#EA580C\", ring: \"rgba(10,10,10,0.5)\", tip: \"#FFFFFF\" },\n};\nconst ICONS = {\n  projects: \"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z\",\n  clients: \"M16 19v-1a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v1M9 10a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm13 9v-1a4 4 0 0 0-3-3.9M16 4.1a3 3 0 0 1 0 5.8\",\n  docs: \"M14 3H6v18h12V7l-4-4Zm0 0v4h4M9 13h6m-6 4h4\",\n  calendar: \"M8 3v3m8-3v3M4 9h16M5 6h14a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1Z\",\n};\n\nconst DEFAULT_SECTIONS: MultiColumnSection[] = [\n  {\n    id: \"projects\",\n    label: \"Projects\",\n    icon: \"projects\",\n    items: [\n      { id: \"p1\", title: \"Website v3\", subtitle: \"Marketing site rebuild\", meta: \"12 tasks\", color: \"#FB923C\", status: \"On track\", details: [[\"Owner\", \"Mara Okafor\"], [\"Due\", \"28 Nov\"], [\"Budget\", \"$48,000\"], [\"Progress\", \"64%\"]] },\n      { id: \"p2\", title: \"Mobile app\", subtitle: \"iOS and Android 2.0\", meta: \"31 tasks\", color: \"#A78BFA\", status: \"At risk\", details: [[\"Owner\", \"Daniel Reyes\"], [\"Due\", \"15 Dec\"], [\"Budget\", \"$120,000\"], [\"Progress\", \"41%\"]] },\n      { id: \"p3\", title: \"Brand refresh\", subtitle: \"Logo, type and colour\", meta: \"8 tasks\", color: \"#4ADE80\", status: \"On track\", details: [[\"Owner\", \"Lena Brandt\"], [\"Due\", \"6 Nov\"], [\"Budget\", \"$22,000\"], [\"Progress\", \"88%\"]] },\n      { id: \"p4\", title: \"Data warehouse\", subtitle: \"Move reporting to one place\", meta: \"19 tasks\", color: \"#60A5FA\", status: \"Paused\", details: [[\"Owner\", \"Tomás Ferreira\"], [\"Due\", \"Jan 2027\"], [\"Budget\", \"$64,000\"], [\"Progress\", \"22%\"]] },\n      { id: \"p5\", title: \"Help center\", subtitle: \"New docs and search\", meta: \"14 tasks\", color: \"#F472B6\", status: \"On track\", details: [[\"Owner\", \"Noor Haddad\"], [\"Due\", \"4 Dec\"], [\"Budget\", \"$18,000\"], [\"Progress\", \"53%\"]] },\n    ],\n  },\n  {\n    id: \"clients\",\n    label: \"Clients\",\n    icon: \"clients\",\n    items: [\n      { id: \"c1\", title: \"Halcyon\", subtitle: \"Enterprise · Berlin\", meta: \"$184k ARR\", color: \"#FB923C\", status: \"Active\", details: [[\"Contact\", \"Priya Nair\"], [\"Since\", \"2023\"], [\"Plan\", \"Enterprise\"], [\"Health\", \"Good\"]] },\n      { id: \"c2\", title: \"Kestrel\", subtitle: \"Business · Lisbon\", meta: \"$62k ARR\", color: \"#60A5FA\", status: \"Renewal\", details: [[\"Contact\", \"Jonas Weber\"], [\"Since\", \"2024\"], [\"Plan\", \"Business\"], [\"Health\", \"Watch\"]] },\n      { id: \"c3\", title: \"Fieldnote\", subtitle: \"Team · Toronto\", meta: \"$14k ARR\", color: \"#4ADE80\", status: \"Active\", details: [[\"Contact\", \"Hana Sato\"], [\"Since\", \"2025\"], [\"Plan\", \"Team\"], [\"Health\", \"Good\"]] },\n    ],\n  },\n  {\n    id: \"docs\",\n    label: \"Docs\",\n    icon: \"docs\",\n    items: [\n      { id: \"d1\", title: \"Q4 planning\", subtitle: \"Edited by Mara\", meta: \"2h ago\", color: \"#FBBF24\", details: [[\"Words\", \"2,140\"], [\"Shared with\", \"Leadership\"], [\"Comments\", \"12\"]] },\n      { id: \"d2\", title: \"Hiring plan 2027\", subtitle: \"Edited by Tomás\", meta: \"Yesterday\", color: \"#A78BFA\", details: [[\"Words\", \"980\"], [\"Shared with\", \"HR\"], [\"Comments\", \"4\"]] },\n    ],\n  },\n];\n\nexport function AppShellMultiColumn({ sections = DEFAULT_SECTIONS, children, theme = \"dark\", className }: AppShellMultiColumnProps) {\n  const p = PALETTES[theme];\n  const reduce = !!useReducedMotion();\n  const uid = React.useId();\n  const [sectionId, setSectionId] = React.useState(sections[0].id);\n  const [selected, setSelected] = React.useState<Record<string, string>>(() => Object.fromEntries(sections.map((s) => [s.id, s.items[0]?.id])));\n  const [q, setQ] = React.useState(\"\");\n  const [aside, setAside] = React.useState(true);\n  const [mobileDetail, setMobileDetail] = React.useState(false);\n  const [hoverRail, setHoverRail] = React.useState<string | null>(null);\n\n  const section = sections.find((s) => s.id === sectionId) ?? sections[0];\n  const query = q.trim().toLowerCase();\n  const items = section.items.filter((i) => !query || `${i.title} ${i.subtitle}`.toLowerCase().includes(query));\n  const item = section.items.find((i) => i.id === selected[section.id]) ?? section.items[0];\n  const ring = { [\"--tw-ring-color\" as string]: p.ring, [\"--tw-ring-offset-color\" as string]: p.rail } as React.CSSProperties;\n  const focus = \"outline-none focus-visible:ring-2 focus-visible:ring-offset-2\";\n  const statusColor = (s?: string) => (s === \"At risk\" || s === \"Renewal\" ? \"#FBBF24\" : s === \"Paused\" ? p.faint : \"#4ADE80\");\n\n  return (\n    <section className={cn(\"@container w-full\", className)} style={{ background: p.bg, color: p.text }}>\n      <div className=\"mx-auto max-w-6xl px-4 py-10 @[640px]:px-6 @[640px]:py-14\">\n        <div className=\"flex h-[620px] overflow-hidden rounded-2xl border\" style={{ background: p.main, borderColor: p.border }}>\n          {/* Rail */}\n          <nav aria-label=\"Sections\" className=\"flex w-14 shrink-0 flex-col items-center gap-1 border-r py-3\" style={{ background: p.rail, borderColor: p.border }}>\n            <span className=\"mb-3 flex h-8 w-8 items-center justify-center rounded-lg text-[12px] font-bold\" style={{ background: p.accent, color: \"#0A0A0A\" }} aria-hidden=\"true\">\n              N\n            </span>\n            {sections.map((s) => {\n              const on = s.id === sectionId;\n              return (\n                <div key={s.id} className=\"relative\">\n                  <button\n                    type=\"button\"\n                    aria-label={s.label}\n                    aria-current={on ? \"page\" : undefined}\n                    onClick={() => {\n                      setSectionId(s.id);\n                      setQ(\"\");\n                      setMobileDetail(false);\n                    }}\n                    onMouseEnter={() => setHoverRail(s.id)}\n                    onMouseLeave={() => setHoverRail(null)}\n                    onFocus={() => setHoverRail(s.id)}\n                    onBlur={() => setHoverRail(null)}\n                    className={cn(\"relative flex h-10 w-10 cursor-pointer items-center justify-center rounded-xl border-0 bg-transparent\", focus)}\n                    style={{ color: on ? p.text : p.faint, ...ring }}\n                  >\n                    {on && <motion.span layoutId={`${uid}-rail`} className=\"absolute inset-0 rounded-xl\" style={{ background: p.sel }} transition={reduce ? { duration: 0 } : { type: \"spring\", stiffness: 500, damping: 38 }} />}\n                    {on && <motion.span layoutId={`${uid}-railbar`} className=\"absolute top-2 bottom-2 -left-2 w-[3px] rounded-full\" style={{ background: p.accent }} transition={reduce ? { duration: 0 } : { type: \"spring\", stiffness: 500, damping: 38 }} />}\n                    <svg className=\"relative\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.7\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n                      <path d={ICONS[s.icon]} />\n                    </svg>\n                  </button>\n                  <AnimatePresence>\n                    {hoverRail === s.id && (\n                      <motion.span initial={reduce ? false : { opacity: 0, x: -4 }} animate={{ opacity: 1, x: 0 }} exit={reduce ? undefined : { opacity: 0 }} className=\"pointer-events-none absolute top-1/2 left-12 z-30 -translate-y-1/2 rounded-md border px-2 py-1 text-[12px] whitespace-nowrap\" style={{ background: p.tip, borderColor: p.border }} aria-hidden=\"true\">\n                        {s.label}\n                      </motion.span>\n                    )}\n                  </AnimatePresence>\n                </div>\n              );\n            })}\n          </nav>\n\n          {/* List column */}\n          <div className={cn(\"flex min-w-0 flex-1 flex-col border-r @[720px]:w-[260px] @[720px]:flex-none\", mobileDetail && \"hidden @[720px]:flex\")} style={{ background: p.list, borderColor: p.border }}>\n            <div className=\"border-b p-3\" style={{ borderColor: p.border }}>\n              <div className=\"flex items-center justify-between px-1 pb-2.5\">\n                <h2 className=\"m-0 text-[15px] font-semibold tracking-[-0.01em]\">{section.label}</h2>\n                <span className=\"text-[12px] tabular-nums\" style={{ color: p.faint }}>\n                  {section.items.length}\n                </span>\n              </div>\n              <label className=\"relative block\">\n                <span className=\"sr-only\">Filter {section.label.toLowerCase()}</span>\n                <svg className=\"pointer-events-none absolute top-1/2 left-2.5 -translate-y-1/2\" width=\"13\" height=\"13\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden=\"true\" style={{ color: p.faint }}>\n                  <circle cx=\"11\" cy=\"11\" r=\"7\" />\n                  <path d=\"m20 20-3.5-3.5\" />\n                </svg>\n                <input type=\"search\" value={q} onChange={(e) => setQ(e.target.value)} placeholder=\"Filter\" className={cn(\"h-8 w-full rounded-lg border pr-2 pl-8 text-[13px]\", focus)} style={{ borderColor: p.border, background: \"transparent\", color: p.text, ...ring }} />\n              </label>\n            </div>\n            <ul className=\"m-0 min-h-0 flex-1 list-none overflow-y-auto p-1.5\" aria-label={section.label}>\n              <AnimatePresence initial={false} mode=\"popLayout\">\n                {items.map((i, k) => {\n                  const on = item?.id === i.id;\n                  return (\n                    <motion.li key={`${section.id}-${i.id}`} layout={!reduce} initial={reduce ? false : { opacity: 0, x: -8 }} animate={{ opacity: 1, x: 0 }} exit={reduce ? undefined : { opacity: 0 }} transition={{ duration: 0.2, delay: reduce ? 0 : k * 0.03 }}>\n                      <button\n                        type=\"button\"\n                        aria-current={on ? \"true\" : undefined}\n                        onClick={() => {\n                          setSelected((s) => ({ ...s, [section.id]: i.id }));\n                          setMobileDetail(true);\n                        }}\n                        className={cn(\"flex w-full cursor-pointer items-center gap-3 rounded-lg border-0 px-2.5 py-2.5 text-left hover:bg-[var(--mc-h)]\", focus)}\n                        style={{ background: on ? p.sel : \"transparent\", color: p.text, [\"--mc-h\" as string]: p.hover, ...ring }}\n                      >\n                        <span className=\"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-[12px] font-bold\" style={{ background: `${i.color}22`, color: i.color }}>\n                          {i.title[0]}\n                        </span>\n                        <span className=\"min-w-0 flex-1\">\n                          <span className=\"block truncate text-[13.5px] font-medium\">{i.title}</span>\n                          <span className=\"block truncate text-[12px]\" style={{ color: p.faint }}>\n                            {i.subtitle}\n                          </span>\n                        </span>\n                        <span className=\"shrink-0 text-[11.5px]\" style={{ color: p.faint }}>\n                          {i.meta}\n                        </span>\n                      </button>\n                    </motion.li>\n                  );\n                })}\n              </AnimatePresence>\n              {items.length === 0 && (\n                <li className=\"px-3 py-8 text-center text-[13px]\" style={{ color: p.muted }}>\n                  No matches.\n                </li>\n              )}\n            </ul>\n          </div>\n\n          {/* Main */}\n          <div className={cn(\"min-w-0 flex-1 flex-col\", mobileDetail ? \"flex\" : \"hidden @[720px]:flex\")}>\n            <header className=\"flex h-14 shrink-0 items-center gap-2 border-b px-3 @[640px]:px-5\" style={{ borderColor: p.border }}>\n              <button type=\"button\" aria-label=\"Back to list\" onClick={() => setMobileDetail(false)} className={cn(\"flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg border-0 bg-transparent @[720px]:hidden\", focus)} style={{ color: p.muted, ...ring }}>\n                <svg width=\"15\" height=\"15\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n                  <path d=\"m10 3-5 5 5 5\" />\n                </svg>\n              </button>\n              <AnimatePresence mode=\"wait\" initial={false}>\n                <motion.div key={item?.id} initial={reduce ? false : { opacity: 0, y: 4 }} animate={{ opacity: 1, y: 0 }} exit={reduce ? undefined : { opacity: 0 }} transition={{ duration: 0.15 }} className=\"flex min-w-0 flex-1 items-center gap-2.5\">\n                  <span className=\"h-2.5 w-2.5 shrink-0 rounded-[3px]\" style={{ background: item?.color }} aria-hidden=\"true\" />\n                  <h1 className=\"m-0 truncate text-[15px] font-semibold\">{item?.title}</h1>\n                  {item?.status && (\n                    <span className=\"shrink-0 rounded-full px-2 py-0.5 text-[11.5px] font-medium\" style={{ background: p.chip, color: statusColor(item.status) }}>\n                      {item.status}\n                    </span>\n                  )}\n                </motion.div>\n              </AnimatePresence>\n              <button type=\"button\" aria-label={aside ? \"Hide details\" : \"Show details\"} aria-pressed={aside} aria-controls={`${uid}-aside`} onClick={() => setAside((a) => !a)} className={cn(\"hidden h-8 w-8 cursor-pointer items-center justify-center rounded-lg border-0 @[960px]:flex\", focus)} style={{ background: aside ? p.chip : \"transparent\", color: p.muted, ...ring }}>\n                <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.7\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n                  <rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\" />\n                  <path d=\"M15 4v16\" />\n                </svg>\n              </button>\n            </header>\n            <div className=\"flex min-h-0 flex-1\">\n              <main className=\"min-h-0 min-w-0 flex-1 overflow-y-auto p-4 @[640px]:p-6\">\n                <AnimatePresence mode=\"wait\" initial={false}>\n                  <motion.div key={`${section.id}-${item?.id}`} initial={reduce ? false : { opacity: 0, y: 8 }} animate={{ opacity: 1, y: 0 }} exit={reduce ? undefined : { opacity: 0 }} transition={{ duration: 0.18 }}>\n                    {item && children ? (\n                      children(item)\n                    ) : (\n                      <>\n                        <p className=\"m-0 text-[13.5px]\" style={{ color: p.muted }}>\n                          {item?.subtitle}\n                        </p>\n                        <div className=\"mt-5 grid gap-3 @[640px]:grid-cols-3\" aria-hidden=\"true\">\n                          {[0, 1, 2].map((k) => (\n                            <div key={k} className=\"h-20 rounded-xl\" style={{ background: p.skel }} />\n                          ))}\n                        </div>\n                        <div className=\"mt-3 flex flex-col gap-2\" aria-hidden=\"true\">\n                          {[0, 1, 2, 3, 4].map((k) => (\n                            <div key={k} className=\"flex h-12 items-center gap-3 rounded-xl px-4\" style={{ background: p.skel }}>\n                              <span className=\"h-3.5 w-3.5 rounded\" style={{ background: p.chip }} />\n                              <span className=\"h-2.5 rounded-full\" style={{ width: `${[56, 34, 48, 40, 28][k]}%`, background: p.chip }} />\n                            </div>\n                          ))}\n                        </div>\n                      </>\n                    )}\n                  </motion.div>\n                </AnimatePresence>\n              </main>\n              <AnimatePresence initial={false}>\n                {aside && item && (\n                  <motion.aside id={`${uid}-aside`} aria-label=\"Details\" initial={reduce ? false : { width: 0, opacity: 0 }} animate={{ width: 240, opacity: 1 }} exit={reduce ? undefined : { width: 0, opacity: 0 }} transition={{ type: \"spring\", stiffness: 380, damping: 38 }} className=\"hidden shrink-0 overflow-hidden border-l @[960px]:block\" style={{ background: p.aside, borderColor: p.border }}>\n                    <div className=\"w-[240px] p-5\">\n                      <p className=\"m-0 text-[12px] font-medium tracking-wide uppercase\" style={{ color: p.faint }}>\n                        Details\n                      </p>\n                      <dl className=\"m-0 mt-3 flex flex-col gap-3\">\n                        {(item.details ?? []).map(([k, v]) => (\n                          <div key={k}>\n                            <dt className=\"text-[11.5px]\" style={{ color: p.faint }}>\n                              {k}\n                            </dt>\n                            <dd className=\"m-0 mt-0.5 text-[13.5px]\">\n                              {k === \"Progress\" ? (\n                                <span className=\"flex items-center gap-2\">\n                                  <span className=\"h-1.5 flex-1 overflow-hidden rounded-full\" style={{ background: p.chip }}>\n                                    <motion.span className=\"block h-full rounded-full\" style={{ background: item.color }} initial={false} animate={{ width: v }} transition={{ duration: reduce ? 0 : 0.5 }} />\n                                  </span>\n                                  <span className=\"tabular-nums\">{v}</span>\n                                </span>\n                              ) : (\n                                v\n                              )}\n                            </dd>\n                          </div>\n                        ))}\n                      </dl>\n                    </div>\n                  </motion.aside>\n                )}\n              </AnimatePresence>\n            </div>\n          </div>\n        </div>\n      </div>\n    </section>\n  );\n}\n\nexport default AppShellMultiColumn;\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}