SlopeChart

Before and after for several things at once. Steep lines are the ones that moved; point at one and the rest step back. Charts.

Open playground
20242025Design $42k$58kEngineering $88k$96kSales $61k$47kSupport $35k$39kOps $28k$51k

About

SlopeChart is a React component in the Charts category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { SlopeChart } from "@ashutoshswamy/smoui" and set data, fromLabel, height among its 4 props.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { SlopeChart } from "@ashutoshswamy/smoui";

<SlopeChart fromLabel="2024" toLabel="2025" data={[{ label: "Design", from: 42, to: 58 }]} />

Props 4

data

One line each. Rising lines use the accent, falling ones red.

{ label; from; to }[]
fromLabel / toLabel

Column headings.

string
height

Default 280.

number
format / prefix / suffix

Number formatting.