{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "table-1",
  "title": "Team Members Data Table",
  "description": "Sortable team members data table with search, checkbox row selection, bulk role and remove actions, status badges, row menus, and pagination.",
  "dependencies": [
    "@tanstack/react-table",
    "@base-ui/react"
  ],
  "registryDependencies": [
    "avatar",
    "badge",
    "button",
    "checkbox",
    "dropdown-menu",
    "input",
    "sonner",
    "table"
  ],
  "files": [
    {
      "path": "registry/blocks/table/1/table-block.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport {\n  sortFn_datetime,\n  type ColumnDef,\n  type ColumnFiltersState,\n  type SortingState,\n  flexRender,\n  tableFeatures,\n  useTable,\n  createSortedRowModel,\n  rowSortingFeature,\n  columnFilteringFeature,\n  createFilteredRowModel,\n  createPaginatedRowModel,\n  rowPaginationFeature,\n  rowSelectionFeature,\n  columnVisibilityFeature,\n  type ColumnVisibilityState,\n} from \"@tanstack/react-table\"\n\nconst TABLE_FEATURES = tableFeatures({\n  rowSortingFeature,\n  columnFilteringFeature,\n  rowPaginationFeature,\n  rowSelectionFeature,\n  columnVisibilityFeature,\n  sortedRowModel: createSortedRowModel(),\n  filteredRowModel: createFilteredRowModel(),\n  paginatedRowModel: createPaginatedRowModel(),\n  sortFns: {\n    datetime: sortFn_datetime,\n  },\n})\nimport { toast } from \"sonner\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Avatar, AvatarFallback, AvatarImage } from \"@/components/ui/avatar\"\nimport { Badge } from \"@/components/ui/badge\"\nimport { Button } from \"@/components/ui/button\"\nimport { Checkbox } from \"@/components/ui/checkbox\"\nimport {\n  DropdownMenu,\n  DropdownMenuCheckboxItem,\n  DropdownMenuContent,\n  DropdownMenuGroup,\n  DropdownMenuItem,\n  DropdownMenuLabel,\n  DropdownMenuSeparator,\n  DropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\"\nimport { Input } from \"@/components/ui/input\"\nimport { Toaster } from \"@/components/ui/sonner\"\nimport {\n  Table,\n  TableBody,\n  TableCell,\n  TableHead,\n  TableHeader,\n  TableRow,\n} from \"@/components/ui/table\"\nimport { IconPlaceholder } from \"@/components/icons/icon-placeholder\"\n\ntype Status = \"Active\" | \"Invited\" | \"Inactive\"\ntype Role = \"Admin\" | \"Editor\" | \"Viewer\"\n\ntype Member = {\n  id: string\n  name: string\n  initials: string\n  avatar: string\n  email: string\n  status: Status\n  role: Role\n  joined: string\n}\n\nconst statusVariant: Record<Status, \"default\" | \"secondary\" | \"outline\"> = {\n  Active: \"default\",\n  Invited: \"secondary\",\n  Inactive: \"outline\",\n}\n\nconst roleClass: Record<Role, string> = {\n  Admin: \"text-foreground font-medium\",\n  Editor: \"text-muted-foreground\",\n  Viewer: \"text-muted-foreground\",\n}\n\nconst COLUMN_LABELS: Record<string, string> = {\n  name: \"Member\",\n  status: \"Status\",\n  role: \"Role\",\n  joined: \"Joined\",\n}\n\nconst members: Member[] = [\n  {\n    id: \"m-01\",\n    name: \"Ada Lovelace\",\n    initials: \"AL\",\n    avatar: \"https://i.pravatar.cc/80?img=47\",\n    email: \"ada@acme.io\",\n    status: \"Active\",\n    role: \"Admin\",\n    joined: \"2026-06-12\",\n  },\n  {\n    id: \"m-02\",\n    name: \"Alan Turing\",\n    initials: \"AT\",\n    avatar: \"https://i.pravatar.cc/80?img=11\",\n    email: \"alan@acme.io\",\n    status: \"Active\",\n    role: \"Editor\",\n    joined: \"2026-06-10\",\n  },\n  {\n    id: \"m-03\",\n    name: \"Grace Hopper\",\n    initials: \"GH\",\n    avatar: \"https://i.pravatar.cc/80?img=45\",\n    email: \"grace@acme.io\",\n    status: \"Invited\",\n    role: \"Editor\",\n    joined: \"2026-06-08\",\n  },\n  {\n    id: \"m-04\",\n    name: \"Linus Pauling\",\n    initials: \"LP\",\n    avatar: \"https://i.pravatar.cc/80?img=12\",\n    email: \"linus@acme.io\",\n    status: \"Inactive\",\n    role: \"Viewer\",\n    joined: \"2026-05-29\",\n  },\n  {\n    id: \"m-05\",\n    name: \"Katherine Johnson\",\n    initials: \"KJ\",\n    avatar: \"https://i.pravatar.cc/80?img=49\",\n    email: \"katherine@acme.io\",\n    status: \"Active\",\n    role: \"Viewer\",\n    joined: \"2026-05-21\",\n  },\n  {\n    id: \"m-06\",\n    name: \"Edsger Dijkstra\",\n    initials: \"ED\",\n    avatar: \"https://i.pravatar.cc/80?img=13\",\n    email: \"edsger@acme.io\",\n    status: \"Active\",\n    role: \"Admin\",\n    joined: \"2026-05-18\",\n  },\n  {\n    id: \"m-07\",\n    name: \"Barbara Liskov\",\n    initials: \"BL\",\n    avatar: \"https://i.pravatar.cc/80?img=44\",\n    email: \"barbara@acme.io\",\n    status: \"Active\",\n    role: \"Editor\",\n    joined: \"2026-05-14\",\n  },\n  {\n    id: \"m-08\",\n    name: \"Tim Berners-Lee\",\n    initials: \"TB\",\n    avatar: \"https://i.pravatar.cc/80?img=14\",\n    email: \"tim@acme.io\",\n    status: \"Invited\",\n    role: \"Viewer\",\n    joined: \"2026-05-09\",\n  },\n  {\n    id: \"m-09\",\n    name: \"Margaret Hamilton\",\n    initials: \"MH\",\n    avatar: \"https://i.pravatar.cc/80?img=48\",\n    email: \"margaret@acme.io\",\n    status: \"Active\",\n    role: \"Editor\",\n    joined: \"2026-05-04\",\n  },\n  {\n    id: \"m-10\",\n    name: \"Donald Knuth\",\n    initials: \"DK\",\n    avatar: \"https://i.pravatar.cc/80?img=15\",\n    email: \"donald@acme.io\",\n    status: \"Inactive\",\n    role: \"Viewer\",\n    joined: \"2026-04-28\",\n  },\n  {\n    id: \"m-11\",\n    name: \"Radia Perlman\",\n    initials: \"RP\",\n    avatar: \"https://i.pravatar.cc/80?img=43\",\n    email: \"radia@acme.io\",\n    status: \"Active\",\n    role: \"Admin\",\n    joined: \"2026-04-22\",\n  },\n  {\n    id: \"m-12\",\n    name: \"Ken Thompson\",\n    initials: \"KT\",\n    avatar: \"https://i.pravatar.cc/80?img=16\",\n    email: \"ken@acme.io\",\n    status: \"Active\",\n    role: \"Editor\",\n    joined: \"2026-04-19\",\n  },\n  {\n    id: \"m-13\",\n    name: \"Hedy Lamarr\",\n    initials: \"HL\",\n    avatar: \"https://i.pravatar.cc/80?img=41\",\n    email: \"hedy@acme.io\",\n    status: \"Invited\",\n    role: \"Viewer\",\n    joined: \"2026-04-15\",\n  },\n  {\n    id: \"m-14\",\n    name: \"Dennis Ritchie\",\n    initials: \"DR\",\n    avatar: \"https://i.pravatar.cc/80?img=17\",\n    email: \"dennis@acme.io\",\n    status: \"Active\",\n    role: \"Editor\",\n    joined: \"2026-04-11\",\n  },\n  {\n    id: \"m-15\",\n    name: \"Shafi Goldwasser\",\n    initials: \"SG\",\n    avatar: \"https://i.pravatar.cc/80?img=40\",\n    email: \"shafi@acme.io\",\n    status: \"Active\",\n    role: \"Viewer\",\n    joined: \"2026-04-07\",\n  },\n  {\n    id: \"m-16\",\n    name: \"John McCarthy\",\n    initials: \"JM\",\n    avatar: \"https://i.pravatar.cc/80?img=18\",\n    email: \"john@acme.io\",\n    status: \"Inactive\",\n    role: \"Viewer\",\n    joined: \"2026-04-02\",\n  },\n  {\n    id: \"m-17\",\n    name: \"Frances Allen\",\n    initials: \"FA\",\n    avatar: \"https://i.pravatar.cc/80?img=39\",\n    email: \"frances@acme.io\",\n    status: \"Active\",\n    role: \"Admin\",\n    joined: \"2026-03-29\",\n  },\n  {\n    id: \"m-18\",\n    name: \"Vint Cerf\",\n    initials: \"VC\",\n    avatar: \"https://i.pravatar.cc/80?img=19\",\n    email: \"vint@acme.io\",\n    status: \"Active\",\n    role: \"Editor\",\n    joined: \"2026-03-24\",\n  },\n  {\n    id: \"m-19\",\n    name: \"Adele Goldberg\",\n    initials: \"AG\",\n    avatar: \"https://i.pravatar.cc/80?img=38\",\n    email: \"adele@acme.io\",\n    status: \"Invited\",\n    role: \"Viewer\",\n    joined: \"2026-03-20\",\n  },\n  {\n    id: \"m-20\",\n    name: \"Bjarne Stroustrup\",\n    initials: \"BS\",\n    avatar: \"https://i.pravatar.cc/80?img=20\",\n    email: \"bjarne@acme.io\",\n    status: \"Active\",\n    role: \"Editor\",\n    joined: \"2026-03-16\",\n  },\n  {\n    id: \"m-21\",\n    name: \"Karen Spärck Jones\",\n    initials: \"KS\",\n    avatar: \"https://i.pravatar.cc/80?img=36\",\n    email: \"karen@acme.io\",\n    status: \"Active\",\n    role: \"Viewer\",\n    joined: \"2026-03-11\",\n  },\n  {\n    id: \"m-22\",\n    name: \"Brian Kernighan\",\n    initials: \"BK\",\n    avatar: \"https://i.pravatar.cc/80?img=51\",\n    email: \"brian@acme.io\",\n    status: \"Inactive\",\n    role: \"Viewer\",\n    joined: \"2026-03-06\",\n  },\n  {\n    id: \"m-23\",\n    name: \"Sophie Wilson\",\n    initials: \"SW\",\n    avatar: \"https://i.pravatar.cc/80?img=35\",\n    email: \"sophie@acme.io\",\n    status: \"Active\",\n    role: \"Editor\",\n    joined: \"2026-03-01\",\n  },\n  {\n    id: \"m-24\",\n    name: \"Guido van Rossum\",\n    initials: \"GR\",\n    avatar: \"https://i.pravatar.cc/80?img=52\",\n    email: \"guido@acme.io\",\n    status: \"Active\",\n    role: \"Admin\",\n    joined: \"2026-02-24\",\n  },\n  {\n    id: \"m-25\",\n    name: \"Lynn Conway\",\n    initials: \"LC\",\n    avatar: \"https://i.pravatar.cc/80?img=34\",\n    email: \"lynn@acme.io\",\n    status: \"Invited\",\n    role: \"Viewer\",\n    joined: \"2026-02-19\",\n  },\n  {\n    id: \"m-26\",\n    name: \"Ralph Merkle\",\n    initials: \"RM\",\n    avatar: \"https://i.pravatar.cc/80?img=53\",\n    email: \"ralph@acme.io\",\n    status: \"Active\",\n    role: \"Editor\",\n    joined: \"2026-02-13\",\n  },\n  {\n    id: \"m-27\",\n    name: \"Carol Shaw\",\n    initials: \"CS\",\n    avatar: \"https://i.pravatar.cc/80?img=32\",\n    email: \"carol@acme.io\",\n    status: \"Active\",\n    role: \"Viewer\",\n    joined: \"2026-02-08\",\n  },\n  {\n    id: \"m-28\",\n    name: \"Niklaus Wirth\",\n    initials: \"NW\",\n    avatar: \"https://i.pravatar.cc/80?img=54\",\n    email: \"niklaus@acme.io\",\n    status: \"Inactive\",\n    role: \"Viewer\",\n    joined: \"2026-02-02\",\n  },\n  {\n    id: \"m-29\",\n    name: \"Mary Allen Wilkes\",\n    initials: \"MW\",\n    avatar: \"https://i.pravatar.cc/80?img=31\",\n    email: \"mary@acme.io\",\n    status: \"Active\",\n    role: \"Admin\",\n    joined: \"2026-01-27\",\n  },\n  {\n    id: \"m-30\",\n    name: \"Leslie Lamport\",\n    initials: \"LL\",\n    avatar: \"https://i.pravatar.cc/80?img=55\",\n    email: \"leslie@acme.io\",\n    status: \"Active\",\n    role: \"Editor\",\n    joined: \"2026-01-21\",\n  },\n]\n\nconst dateFmt = new Intl.DateTimeFormat(\"en-US\", {\n  month: \"short\",\n  day: \"2-digit\",\n  year: \"numeric\",\n})\n\nfunction formatDate(value: string) {\n  const parsed = new Date(value)\n  return Number.isNaN(parsed.getTime()) ? value : dateFmt.format(parsed)\n}\n\nfunction SortIcon({ sorted }: { sorted: false | \"asc\" | \"desc\" }) {\n  if (sorted === \"asc\")\n    return (\n      <IconPlaceholder\n        lucide=\"ArrowUp\"\n        tabler=\"IconArrowUp\"\n        hugeicons=\"ArrowUpIcon\"\n        phosphor=\"ArrowUp\"\n        remixicon=\"RiArrowUpLine\"\n        className=\"size-3.5\"\n        aria-hidden=\"true\"\n      />\n    )\n  if (sorted === \"desc\")\n    return (\n      <IconPlaceholder\n        lucide=\"ArrowDown\"\n        tabler=\"IconArrowDown\"\n        hugeicons=\"ArrowDownIcon\"\n        phosphor=\"ArrowDown\"\n        remixicon=\"RiArrowDownLine\"\n        className=\"size-3.5\"\n        aria-hidden=\"true\"\n      />\n    )\n  return (\n    <IconPlaceholder\n      lucide=\"ChevronsUpDown\"\n      tabler=\"IconArrowsVertical\"\n      hugeicons=\"ArrowUpDownIcon\"\n      phosphor=\"CaretUpDown\"\n      remixicon=\"RiExpandUpDownLine\"\n      className=\"size-3.5 text-muted-foreground/60\"\n      aria-hidden=\"true\"\n    />\n  )\n}\n\nconst columns: ColumnDef<typeof TABLE_FEATURES, Member>[] = [\n  {\n    id: \"select\",\n    enableSorting: false,\n    enableHiding: false,\n    header: ({ table }) => (\n      <Checkbox\n        checked={table.getIsAllPageRowsSelected()}\n        indeterminate={\n          table.getIsSomePageRowsSelected() && !table.getIsAllPageRowsSelected()\n        }\n        onCheckedChange={(checked) =>\n          table.toggleAllPageRowsSelected(checked === true)\n        }\n        aria-label=\"Select all members on this page\"\n      />\n    ),\n    cell: ({ row }) => (\n      <Checkbox\n        checked={row.getIsSelected()}\n        onCheckedChange={(checked) => row.toggleSelected(checked === true)}\n        aria-label={`Select ${row.original.name}`}\n      />\n    ),\n  },\n  {\n    accessorKey: \"name\",\n    header: ({ column }) => (\n      <button\n        type=\"button\"\n        onClick={() => column.toggleSorting(column.getIsSorted() === \"asc\")}\n        className=\"-mx-1 inline-flex items-center gap-1 rounded-md px-1 text-xs font-medium tracking-wide text-muted-foreground uppercase transition-colors hover:text-foreground\"\n      >\n        Member\n        <SortIcon sorted={column.getIsSorted()} />\n      </button>\n    ),\n    filterFn: (row, _id, value: string) => {\n      const q = value.toLowerCase()\n      return (\n        row.original.name.toLowerCase().includes(q) ||\n        row.original.email.toLowerCase().includes(q)\n      )\n    },\n    cell: ({ row }) => {\n      const member = row.original\n      return (\n        <div className=\"flex min-w-0 items-center gap-3\">\n          <Avatar size=\"sm\" className=\"shrink-0 border border-border\">\n            <AvatarImage\n              src={member.avatar}\n              alt={member.name}\n              className=\"grayscale\"\n            />\n            <AvatarFallback className=\"text-xs\">\n              {member.initials}\n            </AvatarFallback>\n          </Avatar>\n          <div className=\"min-w-0\">\n            <p className=\"truncate text-sm leading-tight font-medium\">\n              {member.name}\n            </p>\n            <p className=\"truncate text-xs text-muted-foreground\">\n              {member.email}\n            </p>\n          </div>\n        </div>\n      )\n    },\n  },\n  {\n    accessorKey: \"status\",\n    enableSorting: false,\n    header: () => (\n      <span className=\"text-xs font-medium tracking-wide text-muted-foreground uppercase\">\n        Status\n      </span>\n    ),\n    cell: ({ row }) => (\n      <Badge variant={statusVariant[row.original.status]} className=\"text-xs\">\n        {row.original.status}\n      </Badge>\n    ),\n  },\n  {\n    accessorKey: \"role\",\n    header: ({ column }) => (\n      <button\n        type=\"button\"\n        onClick={() => column.toggleSorting(column.getIsSorted() === \"asc\")}\n        className=\"-mx-1 inline-flex items-center gap-1 rounded-md px-1 text-xs font-medium tracking-wide text-muted-foreground uppercase transition-colors hover:text-foreground\"\n      >\n        Role\n        <SortIcon sorted={column.getIsSorted()} />\n      </button>\n    ),\n    cell: ({ row }) => (\n      <span className={cn(\"text-sm\", roleClass[row.original.role])}>\n        {row.original.role}\n      </span>\n    ),\n  },\n  {\n    accessorKey: \"joined\",\n    sortFn: \"datetime\",\n    header: ({ column }) => (\n      <button\n        type=\"button\"\n        onClick={() => column.toggleSorting(column.getIsSorted() === \"asc\")}\n        className=\"-mx-1 ml-auto inline-flex items-center gap-1 rounded-md px-1 text-xs font-medium tracking-wide text-muted-foreground uppercase transition-colors hover:text-foreground\"\n      >\n        Joined\n        <SortIcon sorted={column.getIsSorted()} />\n      </button>\n    ),\n    cell: ({ row }) => (\n      <span className=\"block text-right text-xs text-muted-foreground tabular-nums\">\n        {formatDate(row.original.joined)}\n      </span>\n    ),\n  },\n  {\n    id: \"actions\",\n    enableSorting: false,\n    enableHiding: false,\n    header: () => <span className=\"sr-only\">Actions</span>,\n    cell: ({ row }) => (\n      <div className=\"flex justify-end\">\n        <DropdownMenu>\n          <DropdownMenuTrigger\n            render={\n              <Button\n                variant=\"ghost\"\n                size=\"icon-sm\"\n                aria-label={`Actions for ${row.original.name}`}\n              >\n                <IconPlaceholder\n                  lucide=\"Ellipsis\"\n                  tabler=\"IconDots\"\n                  hugeicons=\"MoreHorizontalIcon\"\n                  phosphor=\"DotsThree\"\n                  remixicon=\"RiMoreLine\"\n                  className=\"size-4\"\n                  aria-hidden=\"true\"\n                />\n              </Button>\n            }\n          />\n          <DropdownMenuContent align=\"end\" className=\"w-40\">\n            <DropdownMenuItem>\n              <IconPlaceholder\n                lucide=\"User\"\n                tabler=\"IconUser\"\n                hugeicons=\"UserIcon\"\n                phosphor=\"User\"\n                remixicon=\"RiUserLine\"\n                aria-hidden=\"true\"\n              />\n              View Profile\n            </DropdownMenuItem>\n            <DropdownMenuItem>\n              <IconPlaceholder\n                lucide=\"Pencil\"\n                tabler=\"IconPencil\"\n                hugeicons=\"PencilIcon\"\n                phosphor=\"Pencil\"\n                remixicon=\"RiPencilLine\"\n                aria-hidden=\"true\"\n              />\n              Edit\n            </DropdownMenuItem>\n            <DropdownMenuSeparator />\n            <DropdownMenuItem variant=\"destructive\">\n              <IconPlaceholder\n                lucide=\"Trash\"\n                tabler=\"IconTrash\"\n                hugeicons=\"Delete02Icon\"\n                phosphor=\"Trash\"\n                remixicon=\"RiDeleteBinLine\"\n                aria-hidden=\"true\"\n              />\n              Remove\n            </DropdownMenuItem>\n          </DropdownMenuContent>\n        </DropdownMenu>\n      </div>\n    ),\n  },\n]\n\nexport default function TableBlock() {\n  const [sorting, setSorting] = React.useState<SortingState>([\n    { id: \"joined\", desc: true },\n  ])\n  const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>(\n    []\n  )\n  const [columnVisibility, setColumnVisibility] =\n    React.useState<ColumnVisibilityState>({})\n  const [rowSelection, setRowSelection] = React.useState({})\n  const [data, setData] = React.useState(members)\n\n  const table = useTable({\n    features: TABLE_FEATURES,\n    data,\n    columns,\n    getRowId: (row) => row.id,\n    state: { sorting, columnFilters, columnVisibility, rowSelection },\n    onSortingChange: setSorting,\n    onColumnFiltersChange: setColumnFilters,\n    onColumnVisibilityChange: setColumnVisibility,\n    onRowSelectionChange: setRowSelection,\n    initialState: { pagination: { pageIndex: 0, pageSize: 6 } },\n  })\n\n  const nameFilter = (table.getColumn(\"name\")?.getFilterValue() as string) ?? \"\"\n  const selectedCount = table.getFilteredSelectedRowModel().rows.length\n  const totalCount = table.getFilteredRowModel().rows.length\n  const pageCount = table.getPageCount()\n\n  function handleRemove() {\n    const selectedIds = new Set(\n      table.getFilteredSelectedRowModel().rows.map((row) => row.id)\n    )\n    setData((prev) => prev.filter((row) => !selectedIds.has(row.id)))\n    table.resetRowSelection()\n    toast(\"Members removed\", {\n      description: `${selectedIds.size} ${\n        selectedIds.size === 1 ? \"member\" : \"members\"\n      } removed from the workspace.`,\n    })\n  }\n\n  return (\n    <section className=\"flex min-h-svh w-full justify-center bg-background px-4 py-10 text-foreground sm:py-16\">\n      <div className=\"w-full max-w-4xl\">\n        <div className=\"mb-6 flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between\">\n          <div className=\"flex items-center gap-3\">\n            <div className=\"flex size-9 items-center justify-center rounded-md border border-border bg-card text-muted-foreground\">\n              <IconPlaceholder\n                lucide=\"UserCog\"\n                tabler=\"IconShield\"\n                hugeicons=\"ShieldUserIcon\"\n                phosphor=\"Shield\"\n                remixicon=\"RiShieldUserLine\"\n                className=\"size-4\"\n                aria-hidden=\"true\"\n              />\n            </div>\n            <div>\n              <h1 className=\"font-heading text-lg leading-tight font-semibold tracking-tight\">\n                Team Members\n              </h1>\n              <p className=\"text-sm text-muted-foreground\">\n                {data.length} members across 3 workspaces\n              </p>\n            </div>\n          </div>\n          <div className=\"flex items-center gap-2\">\n            <div className=\"relative\">\n              <IconPlaceholder\n                lucide=\"Search\"\n                tabler=\"IconSearch\"\n                hugeicons=\"SearchIcon\"\n                phosphor=\"MagnifyingGlass\"\n                remixicon=\"RiSearchLine\"\n                className=\"pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-foreground\"\n                aria-hidden=\"true\"\n              />\n              <Input\n                type=\"search\"\n                value={nameFilter}\n                onChange={(event) =>\n                  table.getColumn(\"name\")?.setFilterValue(event.target.value)\n                }\n                placeholder=\"Search members...\"\n                className=\"h-7 w-48 pl-8 text-sm\"\n                aria-label=\"Search members by name or email\"\n              />\n            </div>\n            <DropdownMenu>\n              <DropdownMenuTrigger\n                render={\n                  <Button\n                    variant=\"outline\"\n                    size=\"sm\"\n                    aria-label=\"Toggle columns\"\n                  >\n                    <IconPlaceholder\n                      lucide=\"Columns\"\n                      tabler=\"IconColumns\"\n                      hugeicons=\"LayoutLeftIcon\"\n                      phosphor=\"Columns\"\n                      remixicon=\"RiLayoutColumnLine\"\n                      className=\"size-3.5\"\n                      aria-hidden=\"true\"\n                    />\n                    View\n                  </Button>\n                }\n              />\n              <DropdownMenuContent align=\"end\" className=\"w-40\">\n                <DropdownMenuGroup>\n                  <DropdownMenuLabel>Toggle Columns</DropdownMenuLabel>\n                  <DropdownMenuSeparator />\n                  {table\n                    .getAllColumns()\n                    .filter((column) => column.getCanHide())\n                    .map((column) => (\n                      <DropdownMenuCheckboxItem\n                        key={column.id}\n                        checked={column.getIsVisible()}\n                        onCheckedChange={(checked) =>\n                          column.toggleVisibility(checked === true)\n                        }\n                        closeOnClick={false}\n                      >\n                        {COLUMN_LABELS[column.id] ?? column.id}\n                      </DropdownMenuCheckboxItem>\n                    ))}\n                </DropdownMenuGroup>\n              </DropdownMenuContent>\n            </DropdownMenu>\n            <Button size=\"sm\">\n              <IconPlaceholder\n                lucide=\"Plus\"\n                tabler=\"IconPlus\"\n                hugeicons=\"Add01Icon\"\n                phosphor=\"Plus\"\n                remixicon=\"RiAddLine\"\n                className=\"mr-1 size-3.5\"\n                aria-hidden=\"true\"\n              />\n              Invite\n            </Button>\n          </div>\n        </div>\n\n        {selectedCount > 0 && (\n          <div className=\"mb-3 flex flex-wrap items-center justify-between gap-3 rounded-lg border border-border bg-muted/40 px-4 py-2.5\">\n            <div className=\"flex items-center gap-2\">\n              <span className=\"text-sm font-medium text-foreground tabular-nums\">\n                {selectedCount} Selected\n              </span>\n              <Button\n                variant=\"ghost\"\n                size=\"xs\"\n                className=\"text-muted-foreground hover:text-foreground\"\n                onClick={() => table.resetRowSelection()}\n              >\n                Clear\n              </Button>\n            </div>\n            <div className=\"flex flex-wrap items-center gap-2\">\n              <Button\n                variant=\"outline\"\n                size=\"sm\"\n                onClick={() =>\n                  toast(\"Export started\", {\n                    description: `Exporting ${selectedCount} members to CSV.`,\n                  })\n                }\n              >\n                <IconPlaceholder\n                  lucide=\"Download\"\n                  tabler=\"IconDownload\"\n                  hugeicons=\"DownloadIcon\"\n                  phosphor=\"Download\"\n                  remixicon=\"RiDownloadLine\"\n                  className=\"size-3.5\"\n                  aria-hidden=\"true\"\n                />\n                Export\n              </Button>\n              <Button\n                variant=\"outline\"\n                size=\"sm\"\n                onClick={() =>\n                  toast(\"Role updated\", {\n                    description: `Changed the role for ${selectedCount} members.`,\n                  })\n                }\n              >\n                <IconPlaceholder\n                  lucide=\"UserCog\"\n                  tabler=\"IconUserCog\"\n                  hugeicons=\"UserSettingsIcon\"\n                  phosphor=\"UserGear\"\n                  remixicon=\"RiUserSettingsLine\"\n                  className=\"size-3.5\"\n                  aria-hidden=\"true\"\n                />\n                Change role\n              </Button>\n              <Button\n                variant=\"outline\"\n                size=\"sm\"\n                className=\"text-destructive hover:text-destructive\"\n                onClick={handleRemove}\n              >\n                <IconPlaceholder\n                  lucide=\"Trash\"\n                  tabler=\"IconTrash\"\n                  hugeicons=\"Delete02Icon\"\n                  phosphor=\"Trash\"\n                  remixicon=\"RiDeleteBinLine\"\n                  className=\"size-3.5\"\n                  aria-hidden=\"true\"\n                />\n                Remove\n              </Button>\n            </div>\n          </div>\n        )}\n\n        <div className=\"overflow-hidden rounded-xl border border-border bg-card\">\n          <Table>\n            <TableHeader>\n              {table.getHeaderGroups().map((headerGroup) => (\n                <TableRow\n                  key={headerGroup.id}\n                  className=\"border-b border-border bg-muted/40 hover:bg-muted/40\"\n                >\n                  {headerGroup.headers.map((header) => (\n                    <TableHead\n                      key={header.id}\n                      className={cn(\n                        \"h-9\",\n                        header.column.id === \"select\" && \"w-10 pl-4\",\n                        header.column.id === \"name\" && \"pl-1\",\n                        header.column.id === \"joined\" && \"text-right\",\n                        header.column.id === \"actions\" && \"w-10 pr-4\"\n                      )}\n                    >\n                      {header.isPlaceholder\n                        ? null\n                        : flexRender(\n                            header.column.columnDef.header,\n                            header.getContext()\n                          )}\n                    </TableHead>\n                  ))}\n                </TableRow>\n              ))}\n            </TableHeader>\n            <TableBody>\n              {table.getRowModel().rows.length ? (\n                table.getRowModel().rows.map((row) => (\n                  <TableRow\n                    key={row.id}\n                    data-state={row.getIsSelected() ? \"selected\" : undefined}\n                    className=\"border-b border-border transition-colors duration-100 last:border-b-0 hover:bg-muted/30\"\n                  >\n                    {row.getVisibleCells().map((cell) => (\n                      <TableCell\n                        key={cell.id}\n                        className={cn(\n                          \"py-3\",\n                          cell.column.id === \"select\" && \"pl-4\",\n                          cell.column.id === \"name\" && \"pl-1\",\n                          cell.column.id === \"actions\" && \"pr-4\"\n                        )}\n                      >\n                        {flexRender(\n                          cell.column.columnDef.cell,\n                          cell.getContext()\n                        )}\n                      </TableCell>\n                    ))}\n                  </TableRow>\n                ))\n              ) : (\n                <TableRow className=\"hover:bg-transparent\">\n                  <TableCell\n                    colSpan={columns.length}\n                    className=\"h-24 text-center text-sm text-muted-foreground\"\n                  >\n                    No members match your search.\n                  </TableCell>\n                </TableRow>\n              )}\n            </TableBody>\n          </Table>\n\n          <div className=\"flex items-center justify-between gap-4 border-t border-border bg-muted/20 px-4 py-2.5\">\n            <p className=\"text-xs text-muted-foreground\">\n              <span className=\"font-medium text-foreground\">{totalCount}</span>{\" \"}\n              {totalCount === 1 ? \"Result\" : \"Results\"}\n            </p>\n            <div className=\"flex items-center gap-1.5\">\n              <Button\n                variant=\"outline\"\n                size=\"icon\"\n                className=\"size-7\"\n                onClick={() => table.previousPage()}\n                disabled={!table.getCanPreviousPage()}\n                aria-label=\"Previous page\"\n              >\n                <IconPlaceholder\n                  lucide=\"ChevronLeft\"\n                  tabler=\"IconChevronLeft\"\n                  hugeicons=\"ArrowLeft01Icon\"\n                  phosphor=\"CaretLeft\"\n                  remixicon=\"RiArrowLeftSLine\"\n                  className=\"size-3.5\"\n                  aria-hidden=\"true\"\n                />\n              </Button>\n              <span className=\"px-1 text-xs text-muted-foreground tabular-nums\">\n                Page {table.state.pagination.pageIndex + 1} of{\" \"}\n                {Math.max(pageCount, 1)}\n              </span>\n              <Button\n                variant=\"outline\"\n                size=\"icon\"\n                className=\"size-7\"\n                onClick={() => table.nextPage()}\n                disabled={!table.getCanNextPage()}\n                aria-label=\"Next page\"\n              >\n                <IconPlaceholder\n                  lucide=\"ChevronRight\"\n                  tabler=\"IconChevronRight\"\n                  hugeicons=\"ArrowRight01Icon\"\n                  phosphor=\"CaretRight\"\n                  remixicon=\"RiArrowRightSLine\"\n                  className=\"size-3.5\"\n                  aria-hidden=\"true\"\n                />\n              </Button>\n            </div>\n          </div>\n        </div>\n      </div>\n      <Toaster />\n    </section>\n  )\n}\n",
      "type": "registry:component",
      "target": "components/blocks/table-1.tsx"
    }
  ],
  "meta": {
    "height": "640px",
    "tier": "free"
  },
  "docs": "Requires a `base-*` style in components.json (the `shadcn init` default). Legacy `new-york`/`radix-*` styles install Radix primitives, which reject the `render` prop this block uses.",
  "categories": [
    "table"
  ],
  "type": "registry:block"
}