Skip to content
Browse documentation

Set an alert by seeing what it would have done: drag a line across the last 30 days and every day over it turns red while the count of alerts rolls.

Used forMonitoring alertsBudget and spend limitsUsage notificationsBusiness metric alerts

Install with the shadcn CLI

$ npx shadcn@latest add https://hairlineui.com/r/threshold-line.json

Registered the namespace? Then it’s shadcn add @hairline/threshold-line. Set it up

Templates

Need the whole page?

61 Next.js landing pages, each designed from scratch. Try any of them live; one is $39, all of them $159, and 6 are free.

All 61 templates

Where it’s used

  • Monitoring alerts

    Set when latency, error rate or CPU should page someone, against the last month.

  • Budget and spend limits

    Pick a daily spend cap and see which days would have gone over it.

  • Usage notifications

    Choose when a customer is told they are near their quota.

  • Business metric alerts

    Get told when signups or conversion drop below a line you can see.

What it handles for you

A threshold typed into a field is a guess: nobody knows how often 400ms would have fired until it does, usually at night.

Instead of wiring upan alert threshold fielda slider beside a chartan alert previewa draggable annotationa chart library
  1. See it before you save it

    The days over the line turn red as you drag, and the number of alerts rolls in the header.

  2. Exactly how far over

    Only the part of a bar above the line is red, so a near miss and a blow-out look different.

  3. Above or below

    Alert when a metric is above the line, or when it drops below it with the shortfall shown.

  4. A line that feels physical

    It follows the hand 1:1, keeps its speed when thrown, settles on round steps and rubber-bands at the ends.

  5. Your format, your steps

    Milliseconds, percent or money through Intl.NumberFormat; snap to any step.

  6. Keyboard and screen readers

    The tag is a slider: arrows move a step, Page keys ten; its value says how many alerts it means.

Overview

Alert settings usually ask for a number in a field, and you find out whether 400ms was right when the pager goes off at night. Threshold line puts the number on the chart. Drag the line, or its value tag, up and down the last 30 days. Every bar is a stack of 2px hairlines over a faint ruled column, and as the line passes under a bar its hairlines turn red from the line up, one by one, so the part of each day over the limit is exactly the part that is red. A dot drops into the strip under each day that would have fired, and the count in the header rolls. Let go mid-pull and the line keeps its speed, then settles on the nearest round step; past either end it pulls back like a rubber band. For an alert when something drops, days under the line turn red and the shortfall up to the line shows as a pale block. The line is one spring and the bars move by transform only, so dragging never lays out the page.

States

arrive
In view for the first time, the bars grow from the baseline one after another (640ms, 18ms apart).
drag
The line follows the pointer 1:1. Each bar it passes under fills red from the line up; a dot springs into the strip under each day that fires (320ms, slight overshoot) and the count rolls. The tag shows the step the line is on.
throw
On release the line keeps its speed (capped so it never slams past) and settles on the nearest step on a spring; past the ends it rubber-bands back.
below
With direction="below", days under the line turn red and a pale block shows the shortfall from each day up to the line.
keyboard
Arrow keys move the line one step and Page Up and Down ten, on the same spring.
reduced motion
No growth, throw or spring: the line moves straight to the value and dots appear without a pop.

Usage

usage.tsx
import { ThresholdLine } from "@/components/threshold-line";<ThresholdLine  title="Alert when p95 latency is above the line"  period="would have fired in the last 30 days"  data={days} // [{ key: "2026-10-14", value: 512, label: "Tue, 14 Oct", tick: "14 Oct" }, …]  defaultValue={450}  step={10}  format={{ style: "unit", unit: "millisecond", unitDisplay: "short" }}  onValueCommit={(ms) => saveAlert({ p95Above: ms })}/>

Works with

Saving the alert

Load the last 30 days on the server, and save the threshold when a drag or key press is done.

example.tsx
"use client";import { ThresholdLine, type ThresholdLineDatum } from "@/components/threshold-line";export function LatencyAlert({ days, saved }: { days: ThresholdLineDatum[]; saved: number }) {  return (    <ThresholdLine      title="Alert when p95 latency is above the line"      period="would have fired in the last 30 days"      label="Latency alert threshold"      data={days}      defaultValue={saved}      step={10}      format={{ style: "unit", unit: "millisecond", unitDisplay: "short" }}      onValueCommit={(ms) =>        fetch("/api/alerts/latency", { method: "PUT", body: JSON.stringify({ above: ms }) })      }    />  );}

Props

data
ThresholdLineDatum[]
One per bar, oldest first: key, value, label and an optional tick.
value / defaultValue= 70% of the highest day
number
Where the line is; controlled or not.
onValueChange
(value: number) => void
Called each time the line reaches a new step, while dragging too.
onValueCommit
(value: number) => void
Called once when a drag or key press is done: save here.
direction= "above"
"above" | "below"
Fire when a day is over the line, or under it.
min / max= 0 / a round number over the data
number
The ends of the scale and of the line.
step= about a fortieth of the scale
number
What the line settles on.
title= "Alert when above the line"
string
Over the count.
period= "would have fired in this period"
string
Under the count.
label= "Threshold"
string
The slider's accessible name.
format / locales
Intl.NumberFormatOptions / string
How the line's value and the scale read.

Accessibility and motion

  • The value tag is a vertical slider: arrow keys move a step, Page Up and Page Down ten, Home and End the ends. Its value text includes how many alerts it would raise.
  • Every day's figure, and whether it would fire, is in a visually hidden table.
  • Red is only used for days that would fire, always with a dot under them too.
  • The line is one spring from createSpring; bars, fills and the line move by transform, so a drag never lays out the page.
  • Installs Number roll and Text morph. With reduced motion the line moves straight to its value.

Requirements

React 19, Tailwind CSS v4 and shadcn/ui theme variables (any style, light and dark). Icons from lucide-react.

The CLI also installs Number roll, Text morph.

Source

"use client";import * as React from "react";import { NumberRoll } from "./number-roll";import { TextMorph } from "./text-morph";import { createSpring, projectInertia, releaseVelocity, rubberBand, samplePointer, type PointerSample, type Spring } from "./ui-interaction-motion";/* ───────────────────────────────────────────────────────── * THRESHOLD LINE: set an alert by seeing what it would have done * *   arrive    the bars grow out of the baseline one after another *   drag      grab the line (or its value tag) and pull it up or *             down. Every bar it passes under turns red from the line *             up, so the part of each day over the limit is the part *             that's red; a dot drops into the strip under each day *             that would have fired, and the count in the header rolls *   throw     let go mid-pull and the line keeps its speed, then *             settles on the nearest round step; past the ends it *             pulls back like a rubber band *   below     for "alert when below", days under the line turn red *             and the shortfall up to the line shows as a pale block * * The value tag is a slider: arrow keys move a step, Page keys ten. * The line is one spring; the bars are moved by transforms, so * dragging never lays out the page. * ───────────────────────────────────────────────────────── */export interface ThresholdLineDatum {  key: string;  value: number;  /** For screen readers and the hidden table, e.g. "Tue, 14 Oct". */  label: string;  /** A tick under this bar, e.g. "14 Oct". */  tick?: string;}export interface ThresholdLineProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange"> {  data: ThresholdLineDatum[];  value?: number;  defaultValue?: number;  /** Called as the line settles on a new step, while dragging too. */  onValueChange?: (value: number) => void;  /** Called once when a drag or key press is done. */  onValueCommit?: (value: number) => void;  /** Fire when a day is above the line, or below it. */  direction?: "above" | "below";  min?: number;  /** The top of the scale. Defaults to a round number over the data and the line. */  max?: number;  /** What the line snaps to. Defaults to a round step about a fortieth of the scale. */  step?: number;  /** Over the count, e.g. "Alert when p95 latency is above the line". */  title?: string;  /** Under the count, e.g. "would have fired in the last 30 days". */  period?: string;  /** Names the slider, e.g. "p95 latency threshold". */  label?: string;  format?: Intl.NumberFormatOptions;  locales?: string | string[];}const EASE = "cubic-bezier(0.16,1,0.3,1)";const THROW = "cubic-bezier(0.34,1.36,0.64,1)";const FOCUS = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40";const HIT = 28; // the grab band around the line, in px/** The mark: 2px hairlines every 4px, counted up from the baseline. */const RULE = "repeating-linear-gradient(to top, #000 0 2px, transparent 2px 4px)";const reducedQuery = "(prefers-reduced-motion: reduce)";const subscribeReduced = (onChange: () => void) => {  const query = window.matchMedia(reducedQuery);  query.addEventListener("change", onChange);  return () => query.removeEventListener("change", onChange);};const useReducedMotion = () =>  React.useSyncExternalStore(subscribeReduced, () => window.matchMedia(reducedQuery).matches, () => false);// Formatting waits for hydration: the server and the hydrating render share one fixed locale, then the visitor's takes over.const subscribeNothing = () => () => {};const useHydrated = () => React.useSyncExternalStore(subscribeNothing, () => true, () => false);function niceMax(value: number) {  if (value <= 0) return 1;  const step = 10 ** Math.floor(Math.log10(value));  for (const m of [1, 1.2, 1.5, 2, 2.5, 3, 4, 5, 6, 8, 10]) if (m * step >= value) return m * step;  return 10 * step;}function niceStep(range: number) {  const raw = range / 40;  const base = 10 ** Math.floor(Math.log10(raw || 1));  for (const m of [1, 2, 2.5, 5, 10]) if (m * base >= raw) return m * base;  return 10 * base;}const snap = (v: number, step: number, min: number, max: number) => Math.min(max, Math.max(min, Math.round((v - min) / step) * step + min));export function ThresholdLine({  data,  value,  defaultValue,  onValueChange,  onValueCommit,  direction = "above",  min = 0,  max,  step,  title = "Alert when above the line",  period = "would have fired in this period",  label = "Threshold",  format,  locales,  className = "",  ...props}: ThresholdLineProps) {  const reduced = useReducedMotion();  const hydrated = useHydrated();  const locale = locales ?? (hydrated ? undefined : "en-US");  const dataMax = Math.max(0, ...data.map((d) => d.value));  const [own, setOwn] = React.useState(() => defaultValue ?? Math.round(dataMax * 0.7));  const current = value ?? own;  const top = max ?? niceMax(Math.max(dataMax, current) * 1.08);  const unit = step ?? niceStep(top - min);  const above = direction === "above";  const [visible, setVisible] = React.useState(false);  const [firing, setFiring] = React.useState(() => data.map((d) => (above ? d.value > current : d.value < current)));  const [plotH, setPlotH] = React.useState(160);  const [dragging, setDragging] = React.useState(false);  const count = firing.filter(Boolean).length;  const rootRef = React.useRef<HTMLDivElement>(null);  const plotRef = React.useRef<HTMLDivElement>(null);  const lineRef = React.useRef<HTMLDivElement>(null);  const tagTextRef = React.useRef<HTMLSpanElement>(null);  const fillRefs = React.useRef<(HTMLDivElement | null)[]>([]);  const ghostRefs = React.useRef<(HTMLDivElement | null)[]>([]);  const springRef = React.useRef<Spring | null>(null);  const live = React.useRef({ data, top, min, unit, plotH, above, shown: current, firingKey: "", format, locales: locale });  const callbacks = React.useRef({ onValueChange, onValueCommit, setOwn: (v: number) => setOwn(v), controlled: value !== undefined });  // Layout effect, declared first: the paints below must see this render's sizes.  React.useLayoutEffect(() => {    live.current = { ...live.current, data, top, min, unit, plotH, above, format, locales: locale };    callbacks.current = { onValueChange, onValueCommit, setOwn: (v: number) => setOwn(v), controlled: value !== undefined };  });  const fmt = React.useCallback((v: number) => new Intl.NumberFormat(locale, format).format(v), [format, locale]);  // One frame: the line, every bar's red part, and the count when the set of firing days changes.  const paint = React.useCallback(() => {    const s = springRef.current;    const L = live.current;    if (!s) return;    const v = s.get();    const h = L.plotH;    const px = ((v - L.min) / (L.top - L.min)) * h; // the line's height over the baseline    if (lineRef.current) lineRef.current.style.transform = `translate3d(0,${h - px}px,0)`;    let key = "";    for (let i = 0; i < L.data.length; i++) {      const fill = fillRefs.current[i];      if (fill) fill.style.transform = L.above ? `translate3d(0,${-px}px,0)` : "none";      const ghost = ghostRefs.current[i];      // The shortfall block hangs in a box from the plot's top down to the bar; its top edge rides the line.      if (ghost) ghost.style.transform = `translate3d(0,${Math.max(0, h - px)}px,0)`;      key += (L.above ? L.data[i].value > v : L.data[i].value < v) ? "1" : "0";    }    if (key !== L.firingKey) {      L.firingKey = key;      setFiring(Array.from(key, (c) => c === "1"));    }    const shown = snap(v, L.unit, L.min, L.top);    if (shown !== L.shown) {      L.shown = shown;      if (tagTextRef.current) tagTextRef.current.textContent = new Intl.NumberFormat(L.locales, L.format).format(shown);    }  }, []);  React.useEffect(() => {    const s = createSpring(live.current.shown, { stiffness: 520, damping: 44 }, paint, 0.0005 * (live.current.top - live.current.min));    springRef.current = s;    paint();    return () => {      s.stop();      springRef.current = null;    };  }, [paint]);  // A value from outside (controlled, or a key press) moves the line on its spring.  React.useEffect(() => {    const s = springRef.current;    if (!s || dragging) return;    if (reduced) s.jump(current);    else s.set(current);  }, [current, dragging, reduced]);  React.useLayoutEffect(() => paint(), [paint, plotH, top, data, direction]);  React.useLayoutEffect(() => {    const el = plotRef.current;    if (!el) return;    const measure = () => setPlotH((p) => (el.offsetHeight === p || !el.offsetHeight ? p : el.offsetHeight));    measure();    const observer = new ResizeObserver(measure);    observer.observe(el);    return () => observer.disconnect();  }, []);  React.useEffect(() => {    const el = rootRef.current;    if (!el) return;    const observer = new IntersectionObserver(      ([entry]) => {        if (entry.isIntersecting) {          setVisible(true);          observer.disconnect();        }      },      { rootMargin: "0px 0px -10% 0px" },    );    observer.observe(el);    return () => observer.disconnect();  }, []);  const settle = React.useCallback((next: number, commit: boolean) => {    const C = callbacks.current;    if (!C.controlled) C.setOwn(next);    C.onValueChange?.(next);    if (commit) C.onValueCommit?.(next);  }, []);  // Dragging: the line follows the hand 1:1, rubber-bands past the ends, and is thrown onto a step when let go.  const drag = React.useRef<{ id: number; startY: number; startV: number; samples: PointerSample[]; lastStep: number } | null>(null);  const toValue = (dy: number) => {    const L = live.current;    return (dy / L.plotH) * (L.top - L.min);  };  const onPointerDown = (e: React.PointerEvent<HTMLDivElement>) => {    if (e.button !== 0) return;    const s = springRef.current;    if (!s) return;    e.currentTarget.setPointerCapture(e.pointerId);    drag.current = { id: e.pointerId, startY: e.clientY, startV: s.get(), samples: [], lastStep: snap(s.get(), unit, min, top) };    samplePointer(drag.current.samples, e.clientY, e.timeStamp);    s.jump(s.get());    setDragging(true);  };  const onPointerMove = (e: React.PointerEvent<HTMLDivElement>) => {    const d = drag.current;    const s = springRef.current;    if (!d || d.id !== e.pointerId || !s) return;    samplePointer(d.samples, e.clientY, e.timeStamp);    const L = live.current;    let v = d.startV + toValue(d.startY - e.clientY);    // Past either end the line gives less and less, in pixels so it feels the same at any scale.    const span = L.top - L.min;    if (v > L.top) v = L.top + toValue(rubberBand(((v - L.top) / span) * L.plotH, L.plotH));    if (v < L.min) v = L.min - toValue(rubberBand(((L.min - v) / span) * L.plotH, L.plotH));    s.jump(v);    const stepped = snap(v, L.unit, L.min, L.top);    if (stepped !== d.lastStep) {      d.lastStep = stepped;      callbacks.current.onValueChange?.(stepped);    }  };  const onPointerUp = (e: React.PointerEvent<HTMLDivElement>) => {    const d = drag.current;    const s = springRef.current;    if (!d || d.id !== e.pointerId || !s) return;    drag.current = null;    const L = live.current;    const vy = -releaseVelocity(d.samples, e.timeStamp); // px per ms, up is positive    const speed = toValue(vy * 1000); // value per second    const projected = projectInertia(s.get(), toValue(vy), 0.12);    const next = snap(projected, L.unit, L.min, L.top);    if (!reduced) {      // Keep the throw's speed, but never so much that it slams past the step it is headed for.      const room = Math.abs(next - s.get()) * 10;      s.push(Math.sign(speed) * Math.min(Math.abs(speed), room));      s.set(next);    } else s.jump(next);    setDragging(false);    settle(next, true);  };  const onKeyDown = (e: React.KeyboardEvent) => {    const moves: Record<string, number> = {      ArrowUp: current + unit,      ArrowRight: current + unit,      ArrowDown: current - unit,      ArrowLeft: current - unit,      PageUp: current + unit * 10,      PageDown: current - unit * 10,      Home: min,      End: top,    };    if (!(e.key in moves)) return;    e.preventDefault();    const next = snap(moves[e.key], unit, min, top);    if (next !== current) settle(next, true);  };  const slot = data.length ? 100 / data.length : 100;  const every = data.length > 16 ? Math.ceil(data.length / 7) : 1;  const compact = { ...format, notation: "compact" as const, minimumFractionDigits: 0, maximumFractionDigits: 1 };  return (    <div ref={rootRef} className={`w-full rounded-[22px] bg-background shadow-[0_0_0_1px_var(--border)] ${className}`} {...props}>      {/* Its natural width where the parent sizes to its content (a centred flex column), without forcing it on narrow screens. */}      <div aria-hidden="true" data-natural-width className="grid h-0" style={{ gridTemplateColumns: "minmax(0, 600px)" }} />      <div className="@container w-full">      <div className="p-4 @md:p-5 [--plot:150px] @md:[--plot:180px] [--gutter:30px] @md:[--gutter:38px]">        <p className="text-[12px] text-muted-foreground @md:text-[13px]">{title}</p>        <p className="mt-0.5 flex items-baseline gap-1.5 text-foreground">          <span className="text-[22px] font-medium leading-tight tracking-[-0.03em] tabular-nums @md:text-[26px]">            <NumberRoll value={count} duration={700} />          </span>          <span className="text-[13px] text-muted-foreground @md:text-[14px]">            <TextMorph>{count === 1 ? "alert" : "alerts"}</TextMorph>          </span>        </p>        <p className="mt-0.5 text-[11.5px] text-muted-foreground @md:text-[12.5px]">{period}</p>        <div className="relative mt-4 select-none @md:mt-5" style={{ paddingLeft: "var(--gutter)" }}>          {/* The scale: top and middle as hairlines with rolling labels. */}          {[1, 0.5].map((f) => (            <div key={f} aria-hidden="true" className="pointer-events-none absolute inset-x-0" style={{ top: (1 - f) * plotH }}>              <span                className="absolute left-0 top-0 -translate-y-1/2 text-right text-[10.5px] tabular-nums leading-none text-muted-foreground/80"                style={{ width: "calc(var(--gutter) - 8px)" }}              >                <NumberRoll value={min + (top - min) * f} format={compact} locales={locale} duration={700} />              </span>              <div className="border-t border-dashed border-border" style={{ marginLeft: "var(--gutter)" }} />            </div>          ))}          <div ref={plotRef} className="relative" style={{ height: "var(--plot)" }}>            {data.map((d, i) => {              const barH = (Math.max(0, d.value - min) / (top - min)) * plotH;              const fires = firing[i];              return (                <div key={d.key} aria-hidden="true" className="absolute inset-y-0" style={{ left: `${i * slot}%`, width: `${slot}%` }}>                  {/* The mark: one column of 2px hairlines (a mask counted up from the baseline). Its empty part is the                      same lines, faint; the bar lights the lines it reaches, and the alert colour lights the lines past the line. */}                  <div className="absolute inset-y-0 left-1/2 w-[min(18px,64%)] -translate-x-1/2" style={{ maskImage: RULE, WebkitMaskImage: RULE }}>                    <div className="absolute inset-0 bg-foreground/[0.07]" />                    {/* Below mode: the shortfall from the bar's top up to the line. */}                    {!above && (                      <div className="absolute inset-x-0 top-0 overflow-clip" style={{ bottom: barH, opacity: visible ? 1 : 0, transition: reduced ? "none" : `opacity 300ms ${EASE}` }}>                        <div                          ref={(el) => {                            ghostRefs.current[i] = el;                          }}                          className="absolute inset-x-0 top-0 bg-red-500/40 dark:bg-red-400/45"                          style={{ height: plotH, willChange: "transform" }}                        />                      </div>                    )}                    <div                      className="absolute inset-x-0 bottom-0 overflow-clip bg-foreground/[0.3]"                      style={{                        height: visible ? Math.max(2, barH) : 0,                        transition: reduced ? "none" : `height 640ms ${EASE} ${Math.min(i, 30) * 18}ms`,                      }}                    >                      <div                        ref={(el) => {                          fillRefs.current[i] = el;                        }}                        className="absolute inset-x-0 bottom-0 bg-red-500 dark:bg-red-400"                        style={{                          height: above ? plotH : "100%",                          opacity: above || fires ? 1 : 0,                          willChange: above ? "transform" : undefined,                          transition: reduced || above ? "none" : `opacity 220ms ${EASE}`,                        }}                      />                    </div>                  </div>                </div>              );            })}            {/* The line and its tag: a wide grab band with a 1px line through it. */}            <div              ref={lineRef}              className="absolute inset-x-0 top-0 z-10"              style={{ height: 0, willChange: "transform", marginLeft: "calc(var(--gutter) * -1)" }}            >              <div                onPointerDown={onPointerDown}                onPointerMove={onPointerMove}                onPointerUp={onPointerUp}                onPointerCancel={onPointerUp}                className="group absolute inset-x-0 flex cursor-ns-resize touch-none items-center"                style={{ top: -HIT / 2, height: HIT }}              >                <div                  className={`h-px flex-1 transition-colors duration-300 ${count ? "bg-red-500 dark:bg-red-400" : "bg-foreground/55"}`}                  style={{ marginLeft: "var(--gutter)" }}                />                <div                  role="slider"                  tabIndex={0}                  aria-label={label}                  aria-valuemin={min}                  aria-valuemax={top}                  aria-valuenow={current}                  aria-valuetext={`${fmt(current)}, ${count} ${count === 1 ? "alert" : "alerts"} ${period}`}                  aria-orientation="vertical"                  onKeyDown={onKeyDown}                  className={`flex h-[24px] shrink-0 cursor-ns-resize items-center gap-1.5 rounded-full bg-background pl-2 pr-2.5 text-[11.5px] font-medium tabular-nums text-foreground shadow-[0_0_0_1px_var(--border)] transition-[scale,box-shadow] duration-200 ${FOCUS} ${                    dragging ? "scale-[1.04]" : "group-hover:shadow-[0_0_0_1px_color-mix(in_oklab,var(--foreground)_30%,var(--border))]"                  }`}                  style={{ transitionTimingFunction: EASE }}                >                  <svg viewBox="0 0 8 10" aria-hidden="true" className="h-2.5 w-2 text-muted-foreground">                    <path d="M1 3.5 4 1l3 2.5M1 6.5 4 9l3-2.5" fill="none" stroke="currentColor" strokeWidth="1.2" strokeLinecap="round" strokeLinejoin="round" />                  </svg>                  <span ref={tagTextRef}>{fmt(snap(current, unit, min, top))}</span>                </div>              </div>            </div>          </div>          <div aria-hidden="true" className="border-t border-border" />          {/* One dot under each day that would have fired. */}          <div aria-hidden="true" className="relative h-3">            {data.map((d, i) => (              <span                key={d.key}                className="absolute top-[5px] size-[5px] -translate-x-1/2 rounded-full bg-red-500 dark:bg-red-400"                style={{                  left: `${(i + 0.5) * slot}%`,                  scale: firing[i] ? "1" : "0",                  opacity: firing[i] ? 1 : 0,                  transition: reduced ? "none" : `scale 320ms ${firing[i] ? THROW : EASE}, opacity 200ms ${EASE}`,                }}              />            ))}          </div>          <div aria-hidden="true" className="relative h-4">            {data.map((d, i) =>              d.tick && (data.length - 1 - i) % every === 0 ? (                <span                  key={d.key}                  className="absolute top-0 -translate-x-1/2 whitespace-nowrap text-[10.5px] leading-4 text-muted-foreground"                  style={{ left: `clamp(14px, ${(i + 0.5) * slot}%, calc(100% - 14px))` }}                >                  {d.tick}                </span>              ) : null,            )}          </div>        </div>        <div className="sr-only"><table>          <caption>            {label} at {fmt(current)}: {count} {count === 1 ? "alert" : "alerts"} {period}          </caption>          <tbody>            {data.map((d, i) => (              <tr key={d.key}>                <th scope="row">{d.label}</th>                <td>                  {fmt(d.value)}                  {firing[i] ? ", would fire" : ""}                </td>              </tr>            ))}          </tbody>        </table></div>      </div>      </div>    </div>  );}

Registry item: /r/threshold-line.json