Skip to content
GetUrUI

Line charts

4 variantsNew
.md

Four hand-drawn SVG line charts — multi-series, single metric, period comparison and annotated steps — that reveal left to right, morph with springs and read out values on hover or arrow keys.

chartline charttime seriescomparisonannotationstooltipcrosshairsvg

Multi-series

multi-series.tsx

Up to four series, volt first and the rest neutral or dashed; legend toggles rescale the axis with a spring morph and the crosshair reads every visible line.

$npx shadcn@latest add @geturui/line-charts-multi-series
.zip
PropTypeDefaultDescription
title / subtitlestring—Heading and caption.
labelsstring[]—X-axis labels, one per point.
seriesLineSeries[]—{ id, label, values }. The first series is primary.
formatValue(n: number) => string—Formats tooltip values.
formatTick(n: number) => string—Formats y-axis ticks.

Gradient metric

gradient-metric.tsx

One metric under a volt gradient with labelled peak and low markers, an average guide, a glowing latest point and a headline that follows the crosshair.

$npx shadcn@latest add @geturui/line-charts-gradient-metric
.zip
PropTypeDefaultDescription
titlestring"Daily signups"Metric name.
valuesnumber[]—Series, oldest first.
labelsstring[]—One label per value.
formatValue(n: number) => string—Formats headline, ticks and markers.
captionstring"Last 30 days"Caption under the headline.

Period comparison

period-comparison.tsx

This period in solid volt against the last in dashed neutral, the gap shaded, with week, month and quarter tabs that morph both lines together.

$npx shadcn@latest add @geturui/line-charts-period-comparison
.zip
PropTypeDefaultDescription
titlestring"Cumulative bookings"Card heading.
periodsComparisonPeriod[]—{ key, labels, current, previous, previousLabel }. Equal point counts let lines morph.
defaultPeriodstring"Month"Initially selected tab.
formatValue(n: number) => string—Formats values and ticks.

Step with annotations

step-annotations.tsx

A step line for values that change in jumps, a dashed plan limit and numbered notes that pop a callout on hover or focus and step with arrow keys.

$npx shadcn@latest add @geturui/line-charts-step-annotations
.zip
PropTypeDefaultDescription
title / subtitlestring—Heading and caption.
labelsstring[]—One label per step.
valuesnumber[]—Value held from each label until the next.
annotationsStepAnnotation[]—{ index, title, body } notes pinned to points.
limitnumber40Dashed ceiling line.
unitstring"seats"Unit used in copy.

Install the whole set

Installs every line charts variant at once. Each section above has its own command for a single variant.

$npx shadcn@latest add @geturui/line-charts
Download source (.zip)

Accessibility

  • Each chart is role="img" with a summary of its range, extremes or comparison; the plot area is focusable and arrow keys move the crosshair with a polite readout.
  • Legend chips and period tabs are buttons with aria-pressed; annotation markers are buttons that step through with left and right arrows.
  • Axis labels are HTML, strokes stay crisp at any size, and reduced motion swaps the reveal and morphs for an instant render.

Related