Gap-Aware Line

Gap-Aware Line is a copy-paste React component that stops missing readings drawn as zero before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/gap-aware-line
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 1 extra npm package
  • A11y guidance in docs

StopsMissing readings drawn as zero

Was this component page useful?

How do I install Gap-Aware Line?

pnpm dlx shadcn@latest add @bollard/gap-aware-line

The files land in your project. They're yours to edit.

How do I use Gap-Aware Line in React?

gap-aware-line-usage.tsx
import { GapAwareLine, type GapAwareDatum } from "@/components/ui/gap-aware-line"

<GapAwareLine label="Daily UPI payments, ₹ lakh" data={daily} />

What input mistakes does Gap-Aware Line catch?

  • Missing readings drawn as a drop to zero
  • Gaps smoothed over into a false trend
  • A single reading between two gaps disappearing
  • Estimated or modelled values passed off as measured

What props does Gap-Aware Line accept?

GapAwareLine props
PropTypeDefault
data* (required)

Readings in order.

GapAwareDatum[]—
label* (required)

Accessible name and caption.

string—
variant

"chart" has axes and a summary; "sparkline" is a compact inline trend.

"chart" | "sparkline""chart"
height

Plot height in px.

number—
format

Value format for axis, tooltip and table.

(value: number) => string(v) => compact.format(v)
defaultTable

Show the data table instead of the chart at first.

booleanfalse
gapText

Templates: `{from}`, `{to}`, `{count}`, `{gaps}` and `{estimated}` are filled in.

string"No data · {from}"
gapRangeText

Label for a gap spanning several readings.

string"No data · {from} – {to} ({count} readings)"
summaryText

Text summary read with the chart.

string"{gaps} · {estimated}. Breaks are missing data, not zero."
noDataLabel

Shown in the table for a missing reading.

string"No data"
estimatedLabel

Shown in the table for an estimated reading.

string"Estimated"
showTableLabel

Toggle text to show the data table.

string"Table"
showChartLabel

Toggle text to show the chart.

string"Chart"
valueHeader

Table header for the value column.

string"Value"
noteHeader

Table header for the note column.

string"Note"

* required. Also accepts the native props of <figure> (className, aria-*, data-*…), passed through to it.

How is Gap-Aware Line accessible?

  • Chart is role=img with an aria-label that includes a text summary
  • Points are reachable by keyboard (Arrow keys, Home, End) and the active point is read out in a polite live region
  • A toggle (aria-pressed) swaps the chart for a captioned data table; the table stays available to screen readers when hidden
  • Estimated points differ by shape (hollow, dashed), not only colour

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

  • Only null means missing; a real 0 is drawn as 0, so your data must distinguish them
  • Does not detect gaps in timestamps; pass a null for each missing slot
  • Not a general charting library: one series, no zoom

What expensive mistakes does Gap-Aware Line stop?

Missing readings drawn as zero

Also known as

line chart · missing data · null values · time series · gaps · svg chart · monitoring · iot

What dependencies does Gap-Aware Line require?

Gap-Aware Line facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameGap-Aware Line
Registry identifier@bollard/gap-aware-line
Install commandnpx shadcn@latest add @bollard/gap-aware-line
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Gap-Aware Line

What form validation mistake does Gap-Aware Line catch?

Gap-Aware Line prevents missing readings drawn as zero. A line chart that shows missing readings as gaps instead of drawing them as zero or smoothing over them. Catches: Missing readings drawn as a drop to zero, Gaps smoothed over into a false trend, A single reading between two gaps disappearing, Estimated or modelled values passed off as measured. Limitation: validate gap-aware-line schemas on backend.

How do I install gap-aware-line with shadcn?

Run `npx shadcn@latest add @bollard/gap-aware-line`. Sources added: registry/default/gap-aware-line/gap-aware-line.tsx. Package requirements: lucide-react.

What props customize Gap-Aware Line?

Gap-Aware Line accepts `data`, `label`, `variant`, `height`, `format`. Configures line chart, missing data, null values behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of gap-aware-line?

Only null means missing; a real 0 is drawn as 0, so your data must distinguish them. Does not detect gaps in timestamps; pass a null for each missing slot. Not a general charting library: one series, no zoom Server requirement: backend verification for gap-aware-line.

How does Gap-Aware Line meet accessibility guidelines?

Chart is role=img with an aria-label that includes a text summary. Points are reachable by keyboard (Arrow keys, Home, End) and the active point is read out in a polite live region. A toggle (aria-pressed) swaps the chart for a captioned data table; the table stays available to screen readers when hidden. Estimated points differ by shape (hollow, dashed), not only colour. Minimizes errors: missing data shows zero, null values line chart.

Which components pair with Gap-Aware Line?