{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"shadcn-studio/table-16","type":"registry:component","title":"Table 16","description":"A comprehensive product table with avatars, checkboxes, buttons, and action controls","dependencies":["lucide-react"],"registryDependencies":["avatar","button","checkbox","table"],"files":[{"path":"src/registry/new-york/components/table/table-16.tsx","content":"import { useId } from 'react'\n\nimport { ArchiveIcon, PencilIcon, Trash2Icon } from 'lucide-react'\n\nimport { Avatar, AvatarFallback, AvatarImage } from '@/registry/new-york/ui/avatar'\nimport { Button } from '@/registry/new-york/ui/button'\nimport { Checkbox } from '@/registry/new-york/ui/checkbox'\nimport { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/registry/new-york/ui/table'\n\nconst items = [\n  {\n    id: '1',\n    productName: 'Chair',\n    model: 'Wooden Garden  Chair',\n    src: 'https://cdn.shadcnstudio.com/ss-assets/products/product-1.png',\n    fallback: 'WGC',\n    color: 'Black',\n    category: 'Furniture',\n    price: '$269.09'\n  },\n  {\n    id: '2',\n    productName: 'Nike Shoes',\n    model: 'Jordan 1 Retro OG',\n    src: 'https://cdn.shadcnstudio.com/ss-assets/products/product-2.png',\n    fallback: 'J1R',\n    color: 'Red',\n    category: 'Sneakers',\n    price: '$150.00'\n  },\n  {\n    id: '3',\n    productName: 'OnePluse',\n    model: 'OnePlus 7 Pro',\n    src: 'https://cdn.shadcnstudio.com/ss-assets/products/product-3.png',\n    fallback: 'O7P',\n    color: 'Nebula Blue',\n    category: 'Smartphone',\n    price: '$869.00'\n  },\n  {\n    id: '4',\n    productName: 'Nintendo',\n    model: 'Nintendo Switch',\n    src: 'https://cdn.shadcnstudio.com/ss-assets/products/product-4.png',\n    fallback: 'NS',\n    color: 'Neon Blue and Red',\n    category: 'Console Gaming',\n    price: '$499.00'\n  },\n  {\n    id: '5',\n    productName: 'Apple Magic Mouse',\n    model: 'Apple Magic Mouse',\n    src: 'https://cdn.shadcnstudio.com/ss-assets/products/product-5.png',\n    fallback: 'AMM',\n    color: 'Black',\n    category: 'Electronics',\n    price: '$110.29'\n  }\n]\n\nconst ProductTableDemo = () => {\n  const id = useId()\n\n  return (\n    <div className='w-full'>\n      <div className='[&>div]:rounded-sm [&>div]:border'>\n        <Table>\n          <TableHeader>\n            <TableRow className='hover:bg-transparent'>\n              <TableHead>\n                <Checkbox id={id} aria-label='select-all' />\n              </TableHead>\n              <TableHead>Product</TableHead>\n              <TableHead>Color</TableHead>\n              <TableHead>Category</TableHead>\n              <TableHead>Price</TableHead>\n              <TableHead className='w-0 pr-4.5 text-end'>Actions</TableHead>\n            </TableRow>\n          </TableHeader>\n          <TableBody>\n            {items.map(item => (\n              <TableRow key={item.id} className='has-data-[state=checked]:bg-muted/50'>\n                <TableCell>\n                  <Checkbox id={`table-checkbox-${item.id}`} aria-label={`product-checkbox-${item.id}`} />\n                </TableCell>\n                <TableCell>\n                  <div className='flex items-center gap-3'>\n                    <Avatar className='rounded-sm'>\n                      <AvatarImage src={item.src} alt={item.model} />\n                      <AvatarFallback className='text-xs'>{item.fallback}</AvatarFallback>\n                    </Avatar>\n                    <div>\n                      <div className='font-medium'>{item.productName}</div>\n                      <span className='text-muted-foreground mt-0.5 text-xs'>{item.model}</span>\n                    </div>\n                  </div>\n                </TableCell>\n                <TableCell>{item.color}</TableCell>\n                <TableCell>{item.category}</TableCell>\n                <TableCell>{item.price}</TableCell>\n                <TableCell>\n                  <div className='flex items-center gap-1'>\n                    <Button variant='ghost' size='icon' className='rounded-full' aria-label={`product-${item.id}-edit`}>\n                      <PencilIcon />\n                    </Button>\n                    <Button\n                      variant='ghost'\n                      size='icon'\n                      className='rounded-full'\n                      aria-label={`product-${item.id}-remove`}\n                    >\n                      <Trash2Icon />\n                    </Button>\n                    <Button\n                      variant='ghost'\n                      size='icon'\n                      className='rounded-full'\n                      aria-label={`product-${item.id}-archive`}\n                    >\n                      <ArchiveIcon />\n                    </Button>\n                  </div>\n                </TableCell>\n              </TableRow>\n            ))}\n          </TableBody>\n        </Table>\n      </div>\n      <p className='text-muted-foreground mt-4 text-center text-sm'>Product Table</p>\n    </div>\n  )\n}\n\nexport default ProductTableDemo\n","type":"registry:component","target":"components/shadcn-studio/table/table-16.tsx"}]}