package-trendsv0.2.1 Accessibility
  1. package-trends
  2. Using it
  3. Accessibility

Accessibility

A sparkline carries nothing a non-sighted reader can use, so every chart gets a sentence instead.

974,362,450 downloads for react between 2026-09-28 and 2026-10-27, up 1.5% against the half before.
what a screen reader reads

974,362,450 downloads for react between 2026-09-28 and 2026-10-27, up 1.5% against the half before.

The code for what is on screen

<PackageTrend package="react" label="Weekly pulls from npm" />
<PackageTrend package="react" label={(t) => `${t.total.toLocaleString()} downloads`} />
  • The sentence is the SVG's <title>, and label replaces it.
  • Red and green never carry the meaning alone — the sign is always there, which is what a reader with a colour deficiency goes by.
  • interactive makes the chart focusable and arrow-key navigable, and announces the day under the cursor through a live region.
  • A failed fetch renders nothing by default. A download count is never worth breaking a footer over.