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

    3

More in Cards

View all
  • Stats cards with links

    Stats cards with links

    46
  • Course Design Cards

    Course Design Cards

    1.3K
  • Liquid Glass Card

    Liquid Glass Card

    202
  • Statistics Card 2

    Statistics Card 2

    321
  • Card Studio

    Card Studio

    37
  • Astryx Clickable Card

    Astryx Clickable Card

    1
  • Admin Dashboard Cards

    Admin Dashboard Cards

    40
  • Statistics Card 10

    Statistics Card 10

    307