Overview
Switch between content panes.Import
Usage
Live Preview
Run Locally
npm run tsx:core-gallery
Props
- tabs: Array of
{ id: string; label: string; render(parent): void; icon?: string; disabled?: boolean }— Tab descriptors. - activeId?: string — Initially active tab id.
- onChange?: (id: string) => void — Fires when active tab changes.
- orientation?: ‘horizontal’ | ‘vertical’ — Header layout.
- tabHeight?: number — Header height for horizontal orientation.
- BaseProps: position, variant, size, borderStyle, label.
Methods
- setActiveTab(id), getActiveTab(), getActiveTabId().
- setTabs(tabs), addTab(tab), removeTab(id), updateTab(id, updates).
- setTabLabel(id, label), setTabIcon(id, icon), setTabDisabled(id, disabled).
- setOrientation(orientation), setTabHeight(h).
- nextTab(), previousTab(), firstTab(), lastTab().
Keyboard
- Up/Down/Left/Right: navigate header (blessed list default).
- Enter: select highlighted tab.
Installation
Import
Quick Start
Production Examples
Best Practices
- Etichette corte e contenuti leggeri per garantire performance e leggibilità.
