InkUI
Components

Sparkline

Inline mini chart using block characters for trend data.

Visualize time-series data inline using Unicode block characters (▁▂▃▄▅▆▇█).

Live Preview
Sparkline · live time-series
req/s70
cpu%80%
last 16s · peak 126 req/s
~/my-cli — node v22● running

Installation

npx inkui add sparkline

Usage

import { Sparkline } from './components/ui/sparkline';
 
const cpuData = [12, 18, 25, 40, 65, 80, 72, 55, 38, 22, 15, 20];
 
export default function App() {
  return (
    <Sparkline
      data={cpuData}
      label="CPU  "
      showRange
      showLatest
    />
  );
}

API Reference

PropTypeDefaultDescription
datanumber[]Data points (required)
widthnumber20Width in columns
heightnumber1Height in rows (1 or 2)
labelstringLabel before sparkline
showRangebooleanfalseShow min/max values
showLatestbooleantrueShow latest value
colorstringColor override
themeInkUIThemedarkThemeColor theme

On this page