Intentwise Primitives
Compositions
Full dashboard layout demonstrating every primitive type working together. Toggle dark mode to preview theming across all components.
Navigation β TopBar
Pill with Beta tag
Show code
import { TopBar, type TopBarConfig } from '@intentwise/primitives/compositions';
const config: TopBarConfig = {
items: [
{ id: 'org-select', name: 'Organization', type: 'singleSelect', placement: 'left', options, selected, onChange },
{ id: 'account-select', name: 'Account', type: 'singleSelect', placement: 'left', options, selected, onChange },
// Pill version switch with a "Beta" tag
{ id: 'version-switch', name: 'Version switch', type: 'versionSwitch', placement: 'right', data: { label: 'Switch to New UI', tag: 'Beta' }, onSwitch },
{ id: 'theme-toggle', name: 'Theme toggle', type: 'themeToggle', placement: 'right', theme, onClick },
{ id: 'date-range', name: 'Date range', type: 'calendar', placement: 'right', value, onChange, comparison: true, presets },
{ id: 'notifications', name: 'Notifications', type: 'notifications', placement: 'right', notifications, onClickNotification },
{ id: 'profile-menu', name: 'Profile menu', type: 'profileMenu', placement: 'right', profileName, profileEmail, onSignOut },
],
};
<TopBar config={config} />Segmented (on New)
Show code
import { TopBar, type TopBarConfig } from '@intentwise/primitives/compositions';
// Segmented version switch β Classic / New toggle, currently on "new"
const config: TopBarConfig = {
items: [
...baseItems,
{
id: 'version-switch',
name: 'Version switch',
type: 'versionSwitch',
placement: 'right',
variant: 'segmented',
data: { current: 'new', tag: 'Beta', tooltip: 'Switch between Classic and the new Beta experience.' },
onSwitch,
},
],
};
<TopBar config={config} />Switch to Classic UI (on New)
Show code
import { TopBar, type TopBarConfig } from '@intentwise/primitives/compositions';
// Pill version switch shown while on the new UI β offers switching back to Classic
const config: TopBarConfig = {
items: [
...baseItems,
{
id: 'version-switch',
name: 'Version switch',
type: 'versionSwitch',
placement: 'right',
data: { current: 'new' },
onSwitch,
},
],
};
<TopBar config={config} />Legacy (compact)
Show code
import { TopBar, type TopBarConfig } from '@intentwise/primitives/compositions';
import { MessageSquare } from 'lucide-react';
// Compact "legacy" chrome: slim selects, a plain date-range label + preset button,
// a solid/dark icon button, and an avatar-only profile.
const config: TopBarConfig = {
items: [
{ id: 'overview-select', name: 'Overview', type: 'singleSelect', placement: 'left', options, selected, onChange, widthClassName: 'w-[260px]' },
{ id: 'account-select', name: 'Accounts', type: 'singleSelect', placement: 'left', options, selected, onChange, widthClassName: 'w-[260px]' },
// Legacy calendar opens a quick-select-only list (no calendar grid). Pass custom presets to control the options.
// comparison: true adds a "Compare" toggle to the list; enabling it shows the "primary vs comparison" details in the trigger.
{ id: 'date-range', name: 'Date range', type: 'calendar', placement: 'right', value, onChange, presets, comparison: true, comparisonValue, onComparisonChange },
{ id: 'notifications', name: 'Notifications', type: 'notifications', placement: 'right', notifications, onClickNotification },
// appearance: 'solid' renders the dark, high-contrast icon button
{ id: 'chat', name: 'Chat & support', type: 'icon', placement: 'right', appearance: 'solid', icon: <MessageSquare className="h-4 w-4" />, ariaLabel: 'Open chat & support', onClick },
// profileImageUrl shows the avatar photo instead of an initials circle
{ id: 'profile-menu', name: 'Profile menu', type: 'profileMenu', placement: 'right', profileName, profileEmail, profileImageUrl, onSignOut },
],
};
<TopBar variant="legacy" config={config} />Tabbed Navigation β UnderlineTabs
Show code
import { UnderlineTabs, type TabItem } from '@intentwise/primitives/compositions';
<UnderlineTabs
items={[
{ id: 'overview', label: 'Overview' },
{ id: 'campaigns', label: 'Campaigns' },
{ id: 'products', label: 'Products' },
{ id: 'insights', label: 'Insights', isBeta: true },
] satisfies TabItem[]}
activeId={activeTabId}
onChange={setActiveTabId}
/>KPI Summary β MetricCard
Total revenue across all channels
Advertising Cost of Sales
Show code
import { MetricCard } from '@intentwise/primitives/cards';
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
{metricCardSamples.map((data) => (
<MetricCard key={data.title} data={data} />
))}
</div>Micro Indicators β TrendBadge, SparkLine, SparkBar
TrendBadge
SparkLine
SparkBar
Show code
import { TrendBadge } from '@intentwise/primitives/indicators';
import { SparkLine, SparkBar } from '@intentwise/primitives/indicators';
<TrendBadge data={trend.data} />
<SparkLine data={series.data} autoColor />
<SparkBar data={series.data} />Progress & Gauges β ProgressBar, CategoryBar, DeltaBar, ProgressCircle
ProgressBar
CategoryBar
DeltaBar
Revenue Growth
ACoS Change
ProgressCircle
Show code
import { ProgressBar, CategoryBar, DeltaBar } from '@intentwise/primitives/indicators';
import { ProgressCircle } from '@intentwise/primitives/indicators';
<ProgressBar data={bar.data} />
<CategoryBar data={categoryBarData} showLabels />
<DeltaBar data={delta.data} />
<ProgressCircle data={circle.data} size="sm" />Time Series β AreaChart, LineChart
Show code
import { AreaChart, LineChart } from '@intentwise/primitives/charts';
<AreaChart data={areaChartData} title="Revenue & Ad Spend" height={320} exportable />
<LineChart data={dualAxisChartData} title="Revenue vs Growth Rate" height={320} showDots />Categorical β BarChart, DonutChart
Show code
import { BarChart, DonutChart } from '@intentwise/primitives/charts';
<BarChart data={barChartData} title="Revenue by Ad Type" height={320} />
<DonutChart data={donutChartData} title="Revenue by Channel" height={320} />Analytics β ScatterChart, FunnelChart, RadarChart
Show code
import { ScatterChart, FunnelChart, RadarChart } from '@intentwise/primitives/charts';
<ScatterChart data={scatterChartData} title="Ad Spend vs ROAS" height={320} />
<FunnelChart data={funnelChartData} title="Purchase Funnel" height={320} />
<RadarChart data={radarChartData} title="Campaign Health Radar" height={350} />Specialized β HeatMap, WaterfallChart
Show code
import { HeatMap, WaterfallChart } from '@intentwise/primitives/charts';
<HeatMap data={heatMapData} title="Clicks by Day & Hour" height={320} />
<WaterfallChart data={waterfallData} title="Revenue Waterfall" height={320} />Lists & Status β BarList, Tracker
Top Search Terms
Keyword revenue attribution
Campaign Uptime
Last 30 days operational status
Show code
import { BarList, Tracker } from '@intentwise/primitives/compositions';
<BarList data={barListData} />
<Tracker data={trackerData} />Composite β HealthScoreGauge
Account Health Score
Last 30 days performance
Show code
import { HealthScoreGauge } from '@intentwise/primitives/charts';
<HealthScoreGauge
data={healthScoreData}
title="Account Health Score"
description="Last 30 days performance"
/>Tabular β DataTable, ComparisonTable
Campaign Comparison
Side-by-side performance with delta highlighting
| Metric | Campaign A(base) | Campaign B |
|---|---|---|
| Revenue | $12.5K | $15.8K+26.4% |
| ROAS | 3.20 | 4.10+28.1% |
| ACoS | 31.3% | 24.4%-22.0% |
| Impressions | 450K | 520K+15.6% |
| Clicks | 8,500 | 11,200+31.8% |
| CTR | 1.9% | 2.1%+13.8% |
Show code
import { DataTable } from '@intentwise/primitives/tables';
import { ComparisonTable } from '@intentwise/primitives/tables';
<DataTable data={dataTableData} title="Top Customers" striped />
<ComparisonTable data={comparisonTableData} title="Campaign Comparison" />Timeline β TimelineView
Campaign Timeline
Key events and optimization milestones
Initial campaign setup with 50 keywords
Daily budget raised from $50 to $100
CTR dropped below 1.5% threshold
Campaign paused pending bid optimization
Keywords optimized, negative keywords added
$2,500 in attributed sales
Show code
import { TimelineView } from '@intentwise/primitives/compositions';
<TimelineView
data={timelineData}
title="Campaign Timeline"
description="Key events and optimization milestones"
/>Interaction β CommandPalette
Press βK or click the button to open the command palette.
Show code
import { CommandPalette } from '@intentwise/primitives/compositions';
const [open, setOpen] = useState(false);
<CommandPalette
data={commandPaletteData}
open={open}
onOpenChange={setOpen}
onSelect={(id) => setOpen(false)}
/>Composition β TableDataSection
Slot-based layout matching DSP-Web-v2 table pages: filter chip pills, absolute-positioned blue bulk actions bar, and a full-featured table with status badges, currency columns, and totals row.
| Campaign Info | Performance | |||||
|---|---|---|---|---|---|---|
| Status | Campaign name | Total cost | Product sales | Total sales | Impressions | |
| Total | β | $10,800 | $6,780 | $19,100 | 313,400 | |
| Active | Spring Push | $1,200 | $800 | $2,400 | 45,200 | |
| Inactive | Brand Defense | $800 | $400 | $1,600 | 32,100 | |
| Active | Prime Day | $5,000 | $3,200 | $8,400 | 128,000 | |
| Active | Holiday Sale | $3,200 | $2,100 | $5,600 | 89,400 | |
| Inactive | Clearance Q1 | $600 | $280 | $1,100 | 18,700 | |
Show code
import { TableDataSection } from '@intentwise/primitives/compositions';
<TableDataSection
filterChips={filterChips} // optional filter chip row
bulkActionsBar={bulkActionsBar} // optional absolute bulk-actions bar
>
<table>{/* your table markup */}</table>
</TableDataSection>