The signature canvas: one hairline per minute (or 5, 15 min zoomed out) as tall as it was busy, late and at-risk segments at its base, the typical band behind, decisions as pins, and the ahead field of what falls due. Repaints with the theme.
Part of High Command Pro. The preview and props are open to everyone; installing it needs your license key. Set up your key · Pricing
$ npx shadcn@latest add @highcommand/event-fieldCopies the source into your project and pulls in what it needs (4 other items). First time? Add the registry to components.json.
The event field, drawn on a canvas (hundreds of hairlines; the activity log is its table view).
binsrequiredBin[]—The bins to draw, oldest first: each holds its event count and its late, at-risk and decided shares.
bandrequiredBand—typicalBand(bins) and ceilingOf(bins), computed once by the caller (it reads the band out too; O4) and kept for as long as the bins are.
ceilingrequirednumber—The top of the scale in events a minute (ceilingOf(bins)); a bin taller than it is clipped with a break near the top.
widthrequirednumber—Canvas width in px; 0 draws nothing.
heightrequirednumber—Canvas height in px; 0 draws nothing.
focusrequired{ first: number; span: number } | null—The focused column: keep the same object while it stays on one column (useFieldFocus does), or every render redraws the canvas.
labelrequiredstring—Accessible name of the canvas (its aria-label), usually the focused column read in words.
pernumber1Smooth zoom: minutes per bin (a bin holds its count; it stands as tall as its minutes' average, against a band and a ceiling in events a minute), the x of the first bin's left edge (at or left of 0: the window can start inside a bin), and the width of a bin. Without them the bins fill the width evenly, a minute each.
x0number0X in px of the first bin's left edge (0 by default; at or left of 0 when the window starts inside a bin).
bpnumber—Width of one bin in px (default: the width shared evenly across the bins).
xMaxnumber—One continuous scale: the x the field stops at (now's line; the future is not this canvas's). The width by default.
wakebooleantrueWake left to right on first data (the bar's own field); the grid a zoom left, fading out over it, does not.
latticebooleantrueThe typical band's two lines (off on a split row too short to hold them apart from the bars).
decided'line' | 'diamond''line'A decision a person took: a full-height hairline with an accent cap (the combined field), or a diamond at the top of a track.
testIdstring—data-testid for the canvas (default `event-field`, or `event-field-fine` when wake is off).
<AheadField />10 propsThe field's future side: what falls due in the next hours (delivery windows closing, carrier cutoffs, payments, own routes due back), one dashed hairline per 5 minutes, as tall as how much falls due then; a late one wears the late cap.countsrequirednumber[]—How many items fall due in each 5-minute slot from now, in slot order; a slot's box stands as tall as its count.
laterequiredboolean[]—Per slot (same order as counts): true when a late item falls due then, so its box is outlined in the late colour.
widthrequirednumber—Canvas width in px; 0 draws nothing.
heightrequirednumber—Canvas height in px; 0 draws nothing.
typicalrequiredreadonly [number, number] | null—Lower and upper quartile of the typical band (events a minute) carried on as two dashed lines; null draws none.
ceilingrequirednumber—The top of the scale in events a minute (same as the past side's), which the typical lines are placed against.
focusnumber | nullnullIndex of the focused slot, drawn in negative; null (default) for none.
rulebooleantrueThe 5-minute ticks on the baseline (the shared lane); a track's own future side leaves them out.
x0number0One continuous scale: the x of the first slot's left edge (now's line) and a slot's width; the slots fill the width without.
bpnumber—Width of one slot in px (default: the width shared evenly across the slots).
useRootTheme(): string | nullThe page's theme as a key (the data-theme attribute on <html> and the OS setting): canvases read colours from computed style and repaint when it changes.