byDefaultHuman
Components

Line Chart

A hand-drawn line chart with Catmull-Rom curves and animated draw-on.

Installation

package manager
npx shadcn add https://bydefaulthuman.fun/r/line-chart.json

Props

PropTypeDefaultDescription
animateOnMount
boolean
true
Animates the component when it first renders.
formatValue
(v: number) => string
Formats the displayed numeric value.
formatX
(i: number) => string
Formats X-axis labels.
height
number
240
Sets the rendered height in pixels.
id
string
Optional stable id used for sketch seeding and accessibility.
labels
string[]
Labels used by the component.
series*
LineChartSeries[]
Series data used to render the component.
showDots
boolean
true
Shows point markers for each chart value.
showGrid
boolean
true
Shows background grid lines.
theme
CrumbleTheme
Overrides the global Crumble theme for this instance.

Multiple series

Without dots

Accessibility

LineChart is best treated as a visual aid rather than the only source of truth. Include a textual summary or supporting table if exact values and trends need to be accessible.

Examples

import { LineChart } from '@/components/crumble/ui/line-chart'

<LineChart
  labels={["Jan", "Feb", "Mar", "Apr", "May", "Jun"]}
  series={[{ id: "revenue", label: "Revenue", data: [40, 65, 55, 80, 70, 90] }]}
/>