{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "table", "title": "Table", "description": "Structured data table with rows, columns, headers, and cells for displaying tabular data.", "files": [ { "path": "packages/ui/src/table.tsx", "content": "\"use client\";\n\nimport type * as React from \"react\";\nimport { cn } from \"./utils\";\n\n// =============================================================================\n// Table\n// =============================================================================\n\nexport interface TableProps extends React.ComponentProps<\"table\"> {\n /**\n * Whether rows show a hover highlight\n * @default false\n */\n hoverable?: boolean;\n /**\n * The size variant of the table\n * @default \"default\"\n */\n size?: \"default\" | \"sm\";\n /**\n * The visual variant of the table\n * - `default`: Standard bordered rows\n * - `card`: Spaced rows with rounded corners and background fill\n * @default \"default\"\n */\n variant?: \"default\" | \"card\";\n}\n\nconst Table = ({\n className,\n size = \"default\",\n variant = \"default\",\n hoverable = false,\n ref,\n ...props\n}: TableProps & React.RefAttributes) => (\n
\n \n
\n);\n\nTable.displayName = \"Table\";\n\n// =============================================================================\n// TableHeader\n// =============================================================================\n\nexport interface TableHeaderProps extends React.ComponentProps<\"thead\"> {}\n\nconst TableHeader = ({\n className,\n ref,\n ...props\n}: TableHeaderProps & React.RefAttributes) => (\n \n);\n\nTableHeader.displayName = \"TableHeader\";\n\n// =============================================================================\n// TableBody\n// =============================================================================\n\nexport interface TableBodyProps extends React.ComponentProps<\"tbody\"> {}\n\nconst TableBody = ({\n className,\n ref,\n ...props\n}: TableBodyProps & React.RefAttributes) => (\n \n);\n\nTableBody.displayName = \"TableBody\";\n\n// =============================================================================\n// TableFooter\n// =============================================================================\n\nexport interface TableFooterProps extends React.ComponentProps<\"tfoot\"> {}\n\nconst TableFooter = ({\n className,\n ref,\n ...props\n}: TableFooterProps & React.RefAttributes) => (\n tr]:last:border-b-0\",\n className\n )}\n data-slot=\"table-footer\"\n ref={ref}\n {...props}\n />\n);\n\nTableFooter.displayName = \"TableFooter\";\n\n// =============================================================================\n// TableRow\n// =============================================================================\n\nexport interface TableRowProps extends React.ComponentProps<\"tr\"> {}\n\nconst TableRow = ({\n className,\n ref,\n ...props\n}: TableRowProps & React.RefAttributes) => (\n \n);\n\nTableRow.displayName = \"TableRow\";\n\n// =============================================================================\n// TableHead\n// =============================================================================\n\nexport interface TableHeadProps extends React.ComponentProps<\"th\"> {}\n\nconst TableHead = ({\n className,\n ref,\n ...props\n}: TableHeadProps & React.RefAttributes) => (\n \n);\n\nTableHead.displayName = \"TableHead\";\n\n// =============================================================================\n// TableCell\n// =============================================================================\n\nexport interface TableCellProps extends React.ComponentProps<\"td\"> {}\n\nconst TableCell = ({\n className,\n ref,\n ...props\n}: TableCellProps & React.RefAttributes) => (\n \n);\n\nTableCell.displayName = \"TableCell\";\n\n// =============================================================================\n// TableCaption\n// =============================================================================\n\nexport interface TableCaptionProps extends React.ComponentProps<\"caption\"> {}\n\nconst TableCaption = ({\n className,\n ref,\n ...props\n}: TableCaptionProps & React.RefAttributes) => (\n \n);\n\nTableCaption.displayName = \"TableCaption\";\n\n// =============================================================================\n// Exports\n// =============================================================================\n\nexport {\n Table,\n TableBody,\n TableCaption,\n TableCell,\n TableFooter,\n TableHead,\n TableHeader,\n TableRow,\n};\n", "type": "registry:ui" } ], "type": "registry:ui" }