Animated Line Chart

A line chart whose path draws on from left to right

Installation

$ pnpm dlx shadcn@latest add @remocn/animated-line-chart

Usage

// src/Root.tsx
import { Composition } from "remotion";
import { AnimatedLineChart } from "@/components/remocn/animated-line-chart";

const AnimatedLineChartScene = () => (
  <AnimatedLineChart
    data={[12, 19, 8, 15, 22, 18, 28, 25, 32]}
    strokeColor="#22c55e"
  />
);

export const RemotionRoot = () => (
  <Composition
    id="AnimatedLineChart"
    component={AnimatedLineChartScene}
    durationInFrames={90}
    fps={30}
    width={1280}
    height={720}
  />
);

Props

PropTypeDefaultDescription
data
number[][12, 19, 8, 15, 22, 18, 28, 25, 32]Y-values of the chart. Auto-scaled to the available height.
width
number1000SVG viewBox width
height
number500SVG viewBox height
strokeColor
string"#22c55e"Color of the line stroke
strokeWidth
number4Line stroke width in pixels
background
string"#0a0a0a"Outer background color
gridColor
string"#27272a"Grid and axis line color
showDot
booleantrueRender a dot at the leading edge of the line as it draws
className
stringOptional className passed to the outer container