一键导入
groww-table
Table component with header, body, footer, rows, and cells for tabular data display. Use when displaying structured data, lists, or reports.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Table component with header, body, footer, rows, and cells for tabular data display. Use when displaying structured data, lists, or reports.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Accordion component with collapsible sections. Use for FAQs, nested content, or expandable details sections.
Button component with variants, sizes, loading states, and icon support. Use when creating clickable actions, forms, or navigation buttons.
Calendar component for date and month selection. Use when building date pickers, scheduling interfaces, or date range selectors.
Carousel component for image/content sliders with navigation controls. Use for image galleries, hero sections, or content that scrolls horizontally.
Checkbox component for boolean or multi-select inputs. Use when building forms with boolean toggles or multiple selection lists.
Dropdown menu component with trigger and content pattern. Use when building selectable menus, action menus, or nested navigation.
| name | groww-table |
| description | Table component with header, body, footer, rows, and cells for tabular data display. Use when displaying structured data, lists, or reports. |
import Table, {
TableBody,
TableCell,
TableFooter,
TableHeader,
TableHeaderCell,
TableRow
} from '@groww-tech/ui-toolkit/dist/esm/components/atoms/Table';
// or
import { Table, TableBody, TableCell, TableFooter, TableHeader, TableHeaderCell, TableRow } from '@groww-tech/ui-toolkit';
interface TableProps {
children?: React.ReactNode;
className?: string;
style?: React.CSSProperties;
dataTestId?: string;
}
interface TableRowProps {
children?: React.ReactNode;
onClick?: () => void;
className?: string;
isSelected?: boolean;
dataTestId?: string;
}
interface TableCellProps {
children?: React.ReactNode;
className?: string;
style?: React.CSSProperties;
colSpan?: number;
rowSpan?: number;
isHeader?: boolean;
}
interface TableHeaderCellProps {
children?: React.ReactNode;
sortIcon?: React.ReactNode;
onSortClick?: () => void;
isSorted?: boolean;
sortDirection?: 'asc' | 'desc';
className?: string;
style?: React.CSSProperties;
}
<Table>
<TableHeader>
<TableRow>
<TableHeaderCell>Name</TableHeaderCell>
<TableHeaderCell>Email</TableHeaderCell>
<TableHeaderCell>Status</TableHeaderCell>
</TableRow>
</TableHeader>
<TableBody>
{users.map(user => (
<TableRow key={user.id}>
<TableCell>{user.name}</TableCell>
<TableCell>{user.email}</TableCell>
<TableCell>{user.status}</TableCell>
</TableRow>
))}
</TableBody>
</Table>
<Table>
<TableHeader>
<TableRow>
<TableHeaderCell>Item</TableHeaderCell>
<TableHeaderCell>Quantity</TableHeaderCell>
<TableHeaderCell>Price</TableHeaderCell>
</TableRow>
</TableHeader>
<TableBody>
{items.map(item => (
<TableRow key={item.id}>
<TableCell>{item.name}</TableCell>
<TableCell>{item.quantity}</TableCell>
<TableCell>${item.price}</TableCell>
</TableRow>
))}
</TableBody>
<TableFooter>
<TableRow>
<TableCell>Total</TableCell>
<TableCell></TableCell>
<TableCell>${total}</TableCell>
</TableRow>
</TableFooter>
</Table>
<TableHeaderCell
sortIcon={<SortIcon />}
onSortClick={handleSort}
isSorted={sorted}
sortDirection="asc"
>
Name
</TableHeaderCell>
<TableRow onClick={() => handleRowClick(user)}>
<TableCell>{user.name}</TableCell>
<TableCell>{user.email}</TableCell>
</TableRow>
<th> elements