TidalUI

Pivot table preview

Explore supplied aggregates by row group and column with exact totals and expandable segments.

pro · Data · composite

When to use

Alternatives

Configure components.json and the @tidal-pro namespace before installing Pro components.

Installation

npx shadcn@latest add @tidal-pro/pivot-table

Import components/ui/tidal.css, components/ui/pivot-table.css. Wrap installed components in tidal-scope.

Preview

Pivot table component preview

Open interactive preview

Minimal example

import"./components/ui/tidal.css";
import"./components/ui/pivot-table.css";
import{TidalPivotTable}from"./components/ui/pivot-table";
export default(p:Parameters<typeof TidalPivotTable>[0])=><div className="tidal-scope"><TidalPivotTable {...p}/></div>;

API and props

TidalPivotTable.columns (required)
ReadonlyArray<TidalPivotColumn>

Required columns value accepted by this exported component.

TidalPivotTable.expandedIds (required)
ReadonlyArray<string>

Required expanded ids value accepted by this exported component.

TidalPivotTable.onExpandedChange (required)
(ids: readonly string[], event: MouseEvent<HTMLButtonElement>) => void

Callback invoked when the expanded change interaction is proposed.

TidalPivotTable.onSelectedChange (required)
(selection: TidalPivotSelection, event: MouseEvent<HTMLButtonElement>) => void

Callback invoked when the selected change interaction is proposed.

TidalPivotTable.rows (required)
ReadonlyArray<TidalPivotRow>

Required rows value accepted by this exported component.

TidalPivotTable.selected (required)
TidalPivotSelection | null

Required selected value accepted by this exported component.

TidalPivotTable.title (required)
ReactNode

Required title value accepted by this exported component.

TidalPivotTable.cellProps
((row: TidalPivotRow, column: TidalPivotColumn) => ActionProps) | undefined

Optional cell props value accepted by this exported component.

TidalPivotTable.description
ReactNode

Optional description value accepted by this exported component.

TidalPivotTable.disabled
boolean | undefined

Optional disabled value accepted by this exported component.

TidalPivotTable.expandProps
((row: TidalPivotRow) => ActionProps) | undefined

Optional expand props value accepted by this exported component.

TidalPivotTable.exportProps
ActionProps | undefined

Optional export props value accepted by this exported component.

TidalPivotTable.formatValue
((value: number) => string) | undefined

Optional format value value accepted by this exported component.

TidalPivotTable.grandTotal
number | null | undefined

Optional grand total value accepted by this exported component.

TidalPivotTable.headingLevel
"h2" | "h3" | "h4" | "h5" | "h6" | undefined

Optional heading level value accepted by this exported component.

TidalPivotTable.labels
Partial<{ row: string; total: string; totals: string; missing: string; empty: string; invalid: string; export: string; expand: string; collapse: string; selection: string; }> | undefined

Optional labels value accepted by this exported component.

TidalPivotTable.onExport
((event: MouseEvent<HTMLButtonElement>) => void) | undefined

Callback invoked when the export interaction is proposed.

TidalPivotTable.totals
Readonly<Record<string, number | null | undefined>> | undefined

Optional totals value accepted by this exported component.

Complete usage

Full example, stylesheet imports, API and accessibility documentation

Gotchas