Table Component: Layout Wrappers & Portals
When rendering multiple tables within tabs, use the TableWithTabs wrapper component.
Table with Tabs Wrapper Component (TableWithTabs)
TableWithTabs (src/table/TableWithTabs.tsx) is a layout wrapper that renders standard Bootstrap Nav tabs. Each tab maps to a lazy-loaded child component.
This wrapper manages:
- Active tab state.
- Query parameter synchronization in the URL.
- Portals passed down to child tables, allowing them to render search bars, reload triggers, and action buttons directly into the parent card's shared header toolbar.
Basic Usage
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | |
Component Properties
| Property | Type | Description |
|---|---|---|
title |
ReactNode |
Card title text / elements. |
subtitle |
ReactNode |
Optional card subtitle. |
tabs |
TableTab[] |
Array of tab settings (each must have a component key). |
syncWithUrlKey |
string |
Query parameter key used to sync the active tab in the URL (optional). |
data |
Record<string, any> |
Optional properties/payload automatically passed down to all child tab components. |
headerActions |
ReactNode |
Actions rendered directly next to the tab navigation list. |
actions |
ReactNode or Array<{ activeKeys, component }> |
Actions rendered in the header toolbar. |
Child Components Integration (Portals)
When rendering a standard <Table> component inside a TableWithTabs pane, the tab wrapper automatically passes a portal prop containing DOM element references. You must forward this portal prop to your <Table> component to ensure its toolbar buttons and refresh buttons render in the correct card header slot:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | |