npm install @emmgfx/activity-tabsHeadless tabs that keep panel state alive when switching.
Panel content stays mounted and alive when switching tabs — no state reset, no re-render.
Pass className and activeClassName to every component. Zero bundled styles.
No opinions on markup or layout. Compose tabs however your design needs.
Fully typed components and a useActiveTab hook for programmatic control.
Switch tabs and increment the counter — switch back and the count is still there.
Wrap the primitives with your own styles once, reuse everywhere.
useActiveTabUse the hook inside any child component to read or set the active tab from outside the tab buttons.
<Tabs />| Prop | Type | Default | Description |
|---|---|---|---|
initialActiveTab | string | number | undefined | Tab ID to activate on first render. |
className | string | undefined | Class applied to the wrapper div. |
children | ReactNode | — | Should contain TabsList and TabsPanels. |
<TabsTab />| Prop | Type | Default | Description |
|---|---|---|---|
tabId | string | number | — | Unique ID matching the TabsPanel to activate. |
className | string | undefined | Class applied when the tab is inactive. |
activeClassName | string | undefined | Class applied when the tab is active. |
children | ReactNode | — | Tab label content. |
<TabsPanel />| Prop | Type | Default | Description |
|---|---|---|---|
tabId | string | number | — | ID of the tab that reveals this panel. |
className | string | undefined | Class applied to the panel wrapper. |
children | ReactNode | — | Panel content — stays mounted when inactive. |