Klar

Charts / React basic charts / Comparison

Data table with inline charts

Rows with a chart per column type: in-cell bars, deltas, sparklines, heat cells, badges and progress, with sortable sticky headers, a totals row and windowing for long lists.

React component DataTable, data through props. Side by side: who, which source, which version is ahead. Tags: table, grid, sparkline, heatmap cell, sortable, in-cell bar, leaderboard, report.

Install

npm i klar-charts

import 'klar-charts/styles.css'
import { ThemeScope, DataTable } from 'klar-charts'

# or copy the source:
npx shadcn@latest add https://klar.run/r/basic-data-table.json

Usage

<DataTable
  key={m}
  rows={many ? manyRegions : regions}
  columns={regionColumns}
  rowKey={(r) => r.region}
  defaultSort={{ key: 'revenue', dir: 'desc' }}
  totals
  maxHeight={many ? 520 : undefined}
  density={many ? 'compact' : 'comfortable'}
  ariaLabel="Sales by region, quarter to date"
/>

Related data table with inline charts charts