/

Sparkline

Inline mini-charts for tables, dashboards, and text. Compact data visualization without axes or labels.

Usage

example.tsx
import { Sparkline } from "@chartts/react"

<table>
  <tr>
    <td>Revenue</td>
    <td>$48.2k</td>
    <td><Sparkline data={[4,8,6,12,9,14]} /></td>
  </tr>
</table>

Props

PropTypeDescription
datanumber[]Array of numeric values
type'line' | 'bar' | 'area'Sparkline variant. Default: 'line'
colorstringStroke/fill color. Default: '#22d3ee'
widthnumberWidth in px. Default: 100
heightnumberHeight in px. Default: 24
showEndDotbooleanShow dot on last point. Default: true

Features

  • Line, bar, and area variants
  • Inline with text flow
  • Responsive scaling
  • End-point marker
  • Min/max highlighting
  • Band/range overlay

Other Charts