purestackstudio

Line Chart

Cards

About

An animated SVG line chart for comparing one or more labeled data series over equally spaced categories, with optional area fill, point markers, value labels and a grid/zero axis.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Line Chart to your project and fits it to your theme.

Code

How Line Chart is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import LineChart from "@/components/ui/line-chart";

export default function CompactTrendLineChartDemo() {
  return (
    <div className="w-full max-w-sm rounded-lg border border-border bg-card p-4">
      <p className="mb-1 text-xs font-medium uppercase tracking-wide text-muted-foreground">
        Illustrative latency
      </p>
      <h3 className="mb-1 text-lg font-semibold text-foreground">
        18 ms latest measurement
      </h3>
      <p className="mb-3 text-sm text-muted-foreground">
        Six observations across a tuning session.
      </p>
      <LineChart
        title="Latency trend"
        ariaLabel="Latency measurements in milliseconds: 42, 36, 44, 29, 24, 18"
        series={[
          {
            label: "Latency",
            points: [
              { value: 42 },
              { value: 36 },
              { value: 44 },
              { value: 29 },
              { value: 24 },
              { value: 18 },
            ],
          },
        ]}
        height={160}
        curve="linear"
        showArea
        showAxis={false}
        showLabels={false}
        showPoints={false}
      />
    </div>
  );
}

More by purestackstudio

View all
  • Drop Files

    Drop Files

More in Cards

View all
  • Course Design Cards

    Course Design Cards

    1.1K
  • Card

    Card

    70
  • Statistics Card 2

    Statistics Card 2

    273
  • Statistics Card 7

    Statistics Card 7

    301
  • Interactive Tech Stack Bento Grid with Hover Effects

    Interactive Tech Stack Bento Grid with Hover Effects

    184
  • Stats cards with links

    Stats cards with links

    82
  • Weather Card

    Weather Card

    57
  • Card Studio

    Card Studio

    9