Summary / KPI Table
shadcn-table-library/kpi-tableFreeBlock
Compact metrics table with period-over-period change and a hand-rolled SVG sparkline per row.
Install it
npx shadcn@latest add https://shad-table.dev/r/kpi-table.jsonSource
1interface SparklineProps {2 data: number[]3 width?: number4 height?: number5 className?: string6}78export function Sparkline({9 data,10 width = 96,11 height = 28,12 className,13}: SparklineProps) {14 if (data.length < 2) return null1516 const min = Math.min(...data)17 const max = Math.max(...data)18 const range = max - min || 119 const stepX = width / (data.length - 1)2021 const points = data22 .map((value, i) => {23 const x = i * stepX24 const y = height - ((value - min) / range) * height25 return `${x.toFixed(1)},${y.toFixed(1)}`26 })27 .join(' ')2829 return (30 <svg31 width={width}32 height={height}33 viewBox={`0 0 ${width} ${height}`}34 className={className}35 aria-hidden="true"36 >37 <polyline38 points={points}39 fill="none"40 stroke="currentColor"41 strokeWidth={1.5}42 strokeLinecap="round"43 strokeLinejoin="round"44 />45 </svg>46 )47}
What it pulls in
npm packages
Other registry items
Files it writes
More from shadcn-table-library
All 18 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Animated Icons Tableanimated-icons-table | shadcn-table-library | Blocks | Free | 2 deps · 9 files | |
| Comparison Tablecomparison-table | shadcn-table-library | Blocks | Free | 1 dep · 4 files | |
| Data Tabledata-table | shadcn-table-library | Blocks | Free | 1 dep · 4 files | |
| Density & Exportdensity-export-table | shadcn-table-library | Blocks | Free | 1 dep · 4 files | |
| Editable Tableeditable-table | shadcn-table-library | Blocks | Free | 1 dep · 3 files | |
| Grouped Tablegrouped-table | shadcn-table-library | Blocks | Free | 1 dep · 3 files | |
| Heatmap Tableheatmap-table | shadcn-table-library | Blocks | Free | 1 dep · 4 files | |
| Live Status Indicatorslive-status-table | shadcn-table-library | Blocks | Free | 1 dep · 4 files |
