themesberg / themesberg/flowbite-react
[Feature request] We need a new component <Table.HeadRow>
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.1k
- Forks
- 506
- PR merge metrics
- No merged PRs in 30d
Description
- I have searched the Issues to see if this bug has already been reported
- I have tested the latest version
Summary
Hi, I'm trying to implement the @tanstack/react-table library with the Table component, but the tr in the <Table.Head> component is not accessible, and is hardcoded inside the component. Can make a new component for that element please? Regards.
Here is an example and the link to the library
https://tanstack.com/table/latest/docs/introduction
export default function Table<T>({ data, columns }: TableProps<T>) {
const table = useReactTable({
data,
columns,
getCoreRowModel: getCoreRowModel(),
});
return (
<table>
<thead>
{table.getHeaderGroups().map((headerGroup) => (
<tr key={headerGroup.id}> {/* Here, I want to have access to the tr so I can make header groups */}
{headerGroup.headers.map((header) => (
<th key={header.id}>
{flexRender(
header.column.columnDef.header,
header.getContext()
)}
</th>
))}
</tr>
))}
</thead>
<tbody>
{table.getRowModel().rows.map((row) => (
<tr key={row.id}>
{row.getVisibleCells().map((cell) => (
<td key={cell.id}>
{flexRender(cell.column.columnDef.cell, cell.getContext())}
</td>
))}
</tr>
))}
</tbody>
</table>
);
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/ui/src/components/Table/TableHead.tsx at the hardcoded tr in Table.Head, then inspect nearby Table components for naming and prop patterns. Add the requested Table.HeadRow entry point so consumers can control the header row for grouped headers, while preserving existing Table.Head behavior; verify the component still renders correctly with the example usage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100