TabbedDataView

Controlled MUI Tabs shell with render prop content delegation. Supports scrollable tabs, closable tabs, add-tab action, and an actions slot. Tab content is fully delegated via renderTabContent.

Tab Configurations
Orders Tab Set (3 tabs with icons)

Content for: All Orders (type: orders, id: all-orders)

This area would contain a DataGrid, chart, or other data visualization.

Mixed Tab Types (4 tabs, auto-created indicator)

Content for: Orders (type: orders, id: orders-main)

This area would contain a DataGrid, chart, or other data visualization.

Interactive Tab Management

10 tabs

Content for: All Orders (type: orders, id: tab-1)

This area would contain a DataGrid, chart, or other data visualization.

Close tabs with the X button. Add new tabs with the + button. Active: tab-1

Usage

JSX
import { TabbedDataView } from '@so.boss/gloss-ui';
import type { TabConfig } from '@so.boss/gloss-ui';

const tabs: TabConfig[] = [
  { id: 'all', type: 'orders', name: 'All Orders', closable: false },
  { id: 'open', type: 'orders', name: 'Open Orders', closable: true },
  { id: 'shipped', type: 'orders', name: 'Shipped', closable: true },
];

<TabbedDataView
  tabs={tabs}
  activeTabId={activeTab}
  onTabChange={setActiveTab}
  onTabClose={(tabId) => removeTabs(tabId)}
  onTabAdd={() => addNewTab()}
  renderTabContent={(tab) => <DataGrid data={dataForTab(tab)} />}
  actions={<Button onClick={exportData}>Export</Button>}
/>

Props Reference

TabbedDataView

PropTypeDefaultDescription
tabsTabConfig[]โ€”Array of tab configurations
activeTabIdstringโ€”Currently active tab id
onTabChange(tabId: string) => voidโ€”Called when active tab changes
onTabClose(tabId: string) => voidโ€”Called when a tab close button is clicked
onTabAdd() => voidโ€”Shows + button when provided
renderTabContent(tab: TabConfig) => ReactNodeโ€”Render prop for tab panel content
actionsReactNodeโ€”Actions slot (right side of tab bar)

TabConfig

PropertyTypeDescription
idstringUnique tab identifier
typestringTab content type (orders, items, customers, etc.)
namestringDisplay label for the tab
closablebooleanShow close button (default: true via undefined)
iconReactNodeOptional icon before tab label
autoCreatedbooleanShows colored dot indicator for auto-generated tabs