Alert volume
A security card of alerts triaged per day or week, stacked by source, with the escalated few drawn below the line.
alert-volume/alert-volume.tsxAlert volume
Triaged by Halyard
43,969 alerts triaged in 30 days
99.4% closed without a human
- Identity
- Endpoint
- Cloud
- Network
- SaaS
- Escalated
- Auto-closed
- 43,719
- Escalated
- 250
- Median triage
- 38 s
- Analyst time saved
- 1,180 h
The live component, numbered part by part. Every measurement is read from it as it is drawn. Point at a row to outline its part, or at a part to find its row.
The choices it offers, each value drawn live and the default marked, with how to pick one.
When to use
- A count that comes in by day or week and splits into a few named sources, where the mix matters as much as the total.
- A small share that needs its own scale beside the whole: escalations under the line, read on their own axis.
- An overview card a team opens daily, where a handful of filters (period, source, grouping, verdict) cover most questions.
- Up to six or seven series; past that the stacks turn to noise and the legend wraps for lines.
When not to use
- A trend over many months where only the line matters. Use a line or area chart, which reads change better than bars.
- Comparing sources against each other: stacked segments share no baseline. Use grouped bars or small multiples.
- One figure with no history behind it. Use a stat tile, or the four figures at the bottom on their own.
- Data whose readers must act on each row (a queue of alerts to triage). Use a table with filters, and link the card to it.
- Many more than 60 bars: they thin out to slivers. Sum them into weeks, or months, first.
Two scales on one baseline
- Above the line, the alerts: the tallest bar is always 172 px, and the grid lines fall on round numbers under it.
- Below the line, the escalations, on a scale of their own: the deepest is always 40 px, with one round label under the baseline.
- So depth and height don’t compare: a bar 20 px down is not a tenth of one 200 px up. Read the numbers in the note, or the figures.
- With the Escalated verdict, the escalations move up onto the main scale and nothing is drawn below.
What the filters change
- Day / Week lands on that view’s first range: the last 30 days or the last 12 weeks.
- Date range and source change everything: the bars, the total, the share closed without a human and the four figures.
- Group by and verdict change only the bars, the legend and the total; the figures keep counting every verdict.
- Each change grows the bars again from the baseline, clears the ringed bar, and is read out with the new total and dates.
Each one drawn with the component itself, used well or badly.
The card is read in numbers, so its words stay short and the same from one view to the next.
- Name the product in
productby its short name: it followsTriaged byunder the title. - Name each source in a word: Identity, Email, SaaS. They label the legend, the note, the source menu and the readout.
- Say what is counted in the total’s words: alerts triaged, alerts closed without a human, alerts escalated. They change with the verdict.
- Keep figure labels to two or three words, with the unit after the number (
38 s), never in the label. - Write dates short on the axis and in the note (
Oct 2,Wk Sep 14), and in full for screen readers (October 2).
You can add this component with the shadcn CLI or by hand:
Into components/alert-volume of any React project, with no setup:
npx shadcn@latest add https://brunodelorence.com/r/alert-volume.json- Copy the component files
Copy these files into one folder of your project, keeping their relative imports together, or download them as a ZIP:
- Import it
As shown under Usage, below.
Either way it needs React 19.2 and a bundler that supports CSS Modules, such as Next.js or Vite. It has a dark colour scheme: it follows your page’s color-scheme, light unless the page sets one, or its colorScheme prop, with nothing to configure. Browsers without light-dark() show it light.
Usage
import { AlertVolume } from './alert-volume';export function SecurityOverview() { return <AlertVolume product="Halyard" defaultGranularity="week" autoplay={false} />;}Each state below is a live instance, locked so you can study it.
The pieces it is built from, each with its measurements read live.
The card a security team opens to see how many alerts were triaged, and by what. Switch between days and weeks, filter by date range, source and verdict, or drop the grouping; every bar stacks its alerts by source above the baseline and its escalations below it on a scale of their own. Hover a bar and a ring closes round it while a frosted note lists its top three sources, and four figures under the chart follow the filters.
- The data is 26 invented weeks: the last 30 days follow a fixed outline (quiet weekends, a phishing spike on 2 October with 900 email alerts), the weeks before them come from a seeded generator, so every load draws the same chart. Weeks are summed Monday to Sunday from the days.
- The chart is one SVG drawn at the width it is given, read by a ResizeObserver, so its type and spacing keep their size from a phone to a desktop and only the bars’ width (65% of each slot, 24 px at most) follows the space.
- Both scales fill their room: the tallest bar is 172 px and the most escalations 40 px. Grid lines fall on a round step that leaves two or three under the tallest bar (1k, 2k; 5k, 10k), and one round label sits under the baseline.
- Stacked segments are drawn 2 px short of their share, which leaves the gaps between them without moving the top of the bar. Escalations are drawn at 87% opacity, and at full strength on the hovered bar.
- The pointer picks the bar nearest to it; the ring stands 3 px off the bar’s sides and 4 px over its top, down to 3 px under the bottom of its escalations. The note goes on the roomier side with a dotted line to the ring, or floats over the plot when neither side has room, and blurs what is behind it.
- A change of view (switch, range, source, grouping, verdict) gives the bars a new key, so they grow again from the baseline, 9 ms apart: transforms on their own groups, nothing laid out.
- The Day / Week switch keeps a range of its own for each (30 days, 12 weeks). The filters are listboxes the card holds open or shut, which lets the demo open one and move through it the way a reader would.
- While on screen and untouched, a demo pointer hovers the spike and the days around it, switches to weeks, filters to email and back, and returns to days. Any input of the reader’s stops it, and leaves what the reader is hovering in place.
- Every colour is a light-dark() token on the root: a near-black card on a dim stage at night, a white one on pale grey by day, with each source a step deeper so it holds on white.
| Prop | Type | Default | Description |
|---|---|---|---|
product | string | 'Halyard' | The product that triages the alerts, named under the title. |
defaultGranularity | 'day' | 'week' | 'day' | One bar per day (the last 30 days) or per week (the last 12 weeks), at first. |
defaultSource | 'all' | 'Identity' | 'Endpoint' | 'Cloud' | 'Email' | 'Network' | 'SaaS' | 'all' | Only one source’s alerts, or all of them, at first. |
defaultGroupBy | 'source' | 'none' | 'source' | Bars stacked by source, or in one colour, at first. |
defaultVerdict | 'all' | 'auto' | 'escalated' | 'all' | All alerts (escalations drawn below the line), only those closed without a person, or only the escalated ones, at first. |
defaultActive | number | null | null | The bar shown hovered at first, by its index from the left, until the pointer or the keys move on. |
defaultRange | string | — | The date range at first, by its id, one of the granularity’s: '30d', '14d' or '60d' by day, '12w' or '26w' by week (by default the first). Turns the demo off. |
defaultMenu | 'range' | 'source' | 'group' | 'verdict' | null | null | A filter’s menu open at first, its picked option lit, until the reader clicks. Turns the demo off. |
autoplay | boolean | true | While on screen and untouched, a demo pointer hovers bars, switches to weeks and filters by a source. |
colorScheme | 'light' | 'dark' | 'system' | — | Its colours: light, dark, or the reader’s system setting. Without it the component follows the page’s color-scheme, which is light unless the page sets one. |
className | string | — | Extra class for the root. |
Reading the chart
The bars are hidden from screen readers; the chart is a focusable group named with the total, the period and how to read it.
- The arrow keys, Home and End move the ring from bar to bar; Escape clears it.
- Each bar is read out in a polite live region: its date, total, top three sources and escalations (WCAG 4.1.3, Status messages).
- A change of view reads out the new total and dates, so a filter is never a silent change.
Switch and filters
- Day / Week is a radio group with one tab stop; the arrow keys flip it.
- Each filter is a button named by its label and its value, with a hit area 24 px tall (WCAG 2.5.8, Target size (minimum)). Up or Down opens its listbox; the arrow keys, Home and End move, Enter or Space picks, Escape closes, and focus goes back to the button.
- The legend is a list and the four figures a description list, so their labels and numbers are read together.
Colour
On the bars, sources are told apart by colour alone. The legend, the note and the keyboard readout give the same numbers by name (WCAG 1.4.1, Use of colour). Every bar colour, light or dark, keeps 3:1 or more against the card (WCAG 1.4.11, Non-text contrast), and every word keeps 4.5:1 or more against what it sits on (WCAG 1.4.3, Contrast (minimum)).
Motion
Under reduced motion the bars appear without growing, menus open without easing and the demo never plays. The reader’s first input stops the demo where it is, for good: it doesn’t come back until the card is shown again (WCAG 2.2.2, Pause, stop, hide).
In this build
- The card is a section named by its title. Day / Week is a radio group (arrow keys move between them); each filter is a button that opens a listbox, worked with the arrow keys, Home, End, Enter and Escape, and the focus returns to the button.
- The chart is a focusable group with a name that gives the total and the period. The arrow keys, Home and End move from bar to bar, showing the ring and the note, and a polite live region reads out each bar’s date, total, top sources and escalations.
- Changing the view announces the new total and dates. The legend is a list, the four figures a description list; the bars, the note and the demo pointer are hidden from screen readers.
- Under reduced motion the bars appear without growing, menus open without easing and the demo never plays.
The complete source behind this demo. Open source under the MIT license, © 2026 Bruno Delorence: copy it, change it, ship it.
// Copyright (c) 2026 Bruno Delorence. MIT License.'use client';import { useCallback, useEffect, useEffectEvent, useId, useMemo, useRef, useState, type CSSProperties, type KeyboardEvent, type PointerEvent as ReactPointerEvent,} from 'react';import { ANALYST_SECONDS, MEDIAN_TRIAGE, MEDIAN_TRIAGE_ALL, RANGES, SOURCES, buckets, longDate,/* Alert volume (alert-volume.tsx): a near-black card on a dim stage, or by day a white one on a pale grey stage. The card is 600 px at most and lays itself out from its own width (a container query): filters and figures go two by two on a phone. Colours are the tokens below, light-dark(light, dark) where the two differ: the component takes the color-scheme it inherits from the page (light unless the page says otherwise), or the one its colorScheme prop sets (data-color-scheme). Memory. The bars grow by transforms on their own groups, the demo pointer moves by transforms, and the note over the chart is the only thing that blurs what is behind it. */.root { /* The stage around the card, its frame, and the card. */ --stage: #ececec; --stage-2: #f6f6f6; --frame: #e2e2e2; --card: #fff; /* Lines between the card's bands, and the boxes in it (icon, switch, menus). */ --line: #ececec; --box: #f6f6f6; --box-line: #e6e6e6; --box-on: #fff; --box-on-line: #e0e0e0; /* Words: the strongest, the softer, the muted; each 4.5:1 or more on the card and the boxes. */// Copyright (c) 2026 Bruno Delorence. MIT License./* * The alerts behind the card: 26 weeks of invented days, Monday 13 April to Sunday 11 October, * each with its alerts by source and how many of them were escalated to a person. The last 30 * days follow a fixed outline (quiet weekends, a spike of phishing on 2 October); the weeks * before them come from a seeded generator, so every load draws the same chart. */export const SOURCES = ['Identity', 'Endpoint', 'Cloud', 'Email', 'Network', 'SaaS'] as const;export type Source = (typeof SOURCES)[number];export type Day = { /** Midnight UTC of the day, in ms. */ time: number; /** Alerts per source, in the order of SOURCES; escalated ones included. */ alerts: number[]; /** Of those, how many went to a person, per source. */ escalated: number[];};const DAY = 86_400_000;/** The last day drawn: Sunday 11 October 2026. */const LAST = Date.UTC(2026, 9, 11);// Copyright (c) 2026 Bruno Delorence. MIT License.'use client';import { useEffect, useId, useRef, type KeyboardEvent } from 'react';import styles from './alert-volume.module.css';/* * One of the card's filters: a small label over its value, which opens a listbox under it. The * card owns whether it is open and which option is lit, so its demo can open a menu and move * through it like a reader would; the menu itself only reports what the reader does. */export type Option = { value: string; label: string; /** Muted words at the end of the row (a date range's dates). */ hint?: string; /** A colour swatch before the label (a source's colour). */ swatch?: string;};export function FilterMenu({ name,'use client';import type { CSSProperties, Ref } from 'react';/* * The demo's pointer, and the steps that move it. A demo is a script of awaited steps: wait, or * glide the pointer somewhere. Stopping the demo (the reader takes over, or it scrolls away) ends * the step in progress at once: its promise rejects, which ends the script right there, and the * pointer fades out. * * Each glide is a curved flight played by the Web Animations API, so nothing runs frame by frame. * The points of the flight are handed to whoever wants to move along with it (the eye of the * badge, which plays its own animation on the same clock). The arrow and the hand are HTML boxes * that swap by their visibility: a change of style inside an SVG would lay the SVG out again. */export type Point = { x: number; y: number };/** A glide's path and timing, for an animation that plays along with it. */export type Flight = { points: Point[]; timing: KeyframeAnimationOptions };export type Demo = { /** Resolves after `ms`. */ wait: (ms: number) => Promise<void>;'use client';import { useCallback, useEffect, useRef, useState } from 'react';/* * When a demo may play on its own: while part of it is on screen and the tab is visible, never * under reduced motion, and never again once the reader has used it. `take()` hands it to the reader * for good: the demo stays stopped until the component mounts again (WCAG 2.2.2). */export function useAutoplay<T extends HTMLElement>() { const ref = useRef<T>(null); const [visible, setVisible] = useState(false); const [reduced, setReduced] = useState(true); const [taken, setTaken] = useState(false); useEffect(() => { const element = ref.current; if (!element) return; let onScreen = false; const update = () => setVisible(onScreen && !document.hidden); const observer = new IntersectionObserver( ([entry]) => { onScreen = entry.isIntersecting; update();