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

    2

More in Cards

View all
  • Course Design Cards

    Course Design Cards

    1.3K
  • Statistics Card 7

    Statistics Card 7

    327
  • Statistics Card 2

    Statistics Card 2

    305
  • Interactive Tech Stack Bento Grid with Hover Effects

    Interactive Tech Stack Bento Grid with Hover Effects

    625
  • Card Studio

    Card Studio

    5
  • The Item one

    The Item one

    4
  • Weather Card

    Weather Card

    65
  • Card

    Card

    9