Table Header Group 📊
A component for managing grouped column headers in React Table Grid with support for custom rendering and styling
Table Header Group 📊
The TableHeaderGroup
component manages grouped headers in your table, allowing you to organize related columns together in a clean and intuitive way. It automatically generates header groups based on column configurations and supports custom rendering.
Features ✨
- 🔄 Automatic group generation
- 📌 Support for pinned columns
- 🎨 Custom group rendering
- 🎭 With/without Tailwind styling
- ♿ Full accessibility support
- 📱 Responsive grid layout
Basic Usage
Props
Required Props
tableInstance
The table instance from useTableGrid hook that manages the table state.
Optional Props
className
Add custom CSS classes to the header group container.
style
Add custom inline styles to the header group container.
TableColumnClassName
Add custom CSS classes to each group header cell.
headerGroupClassName
Add custom CSS classes specifically to the group headers.
withoutTailwind
Use without Tailwind CSS styling.
- Type:
boolean
- Default:
false
customRender
Custom render function for group headers.
Column Configuration
To create header groups, add a group
property to your columns:
Styling
With Tailwind (Default)
Without Tailwind
Examples
Basic Header Groups
Custom Group Rendering
With Pinned Columns
Accessibility ♿
The TableHeaderGroup component implements these accessibility features:
role="rowgroup"
for the containerrole="columnheader"
for group headersaria-label
for group descriptionsaria-colspan
for proper group spans- Proper heading hierarchy
- Screen reader support
Best Practices 💡
- Use meaningful group names
- Keep groups logically organized
- Provide clear visual hierarchy
- Consider responsive layouts
- Maintain consistent styling
- Use appropriate ARIA labels
- Test with screen readers
Integration with TableGrid
The TableHeaderGroup is typically used within the TableGrid component:
Related Components
Last updated on