High Command
LibraryTemplatesGet startedPricing
Get Pro · $79

Guide

Browse everythingGetting startedThemingYour data

Site

HomeTemplatesPricingChangelog

Templates 4

Command centerProFleetProCustomer trackingProField servicePro

Ops and shell 9

App shellProOps modelProAttention queueProMorning briefProShift handoverProLane panelProOwn-fleet partsProAgent action barProCustomizable dashboardPro

Map 17

PMTiles basemapPMTiles routeTrip hologramProBasemap styleMap geometryMapLand texture and dot lensProException heatmap and risk contoursProLane arcsProShipment layerOwn fleet layerProFleet map layersCurated place labels and sitesRoute traceEdge chipsProMap key, filters and paddingMap kitPro

Time and trips 11

Time and trip modelsEvent fieldProIn-transit rowsProImpact lineProActivity barProReplay clockTime controlPlayback overlayProTrip timetableProStage rowWeek cursorPro

Figures, charts and tables 14

Sourced valueKey-figure tileFigure groupPart barBand sparklineKPI stripProChart kitPop barWaterfall cascadeMargin chartsPro13-week cash ladderProWork tableProField railProHorizon gridPro

Zones and dispatch 10

Zones modelDispatch modelProGeofence layerGeofence eventsGeofence drawProService ringsDensity heatmapJob queueProAssign dialogProStop listPro

Design system 3

ThemeShared helpersUI primitives

Routing 3

Offline road routerAustin road graphAustin areas

Libraries 2

Fleet coreRoute core
High Command

Map, fleet and ops-console components for React. Built in-house, copied into your app with the shadcn CLI.

Product

  • Library
  • Templates
  • Pricing
  • Changelog

Build

  • Get started
  • Accessibility
  • Trip hologram

Templates

  • Command center
  • Fleet
  • Field service

New pieces by email. A short note when a release lands.

One email per release. Unsubscribe any time.

© 2026 High Command Pro licenseTermsPrivacyRefundsMap data © OpenStreetMap contributors · OpenFreeMap
Library/Design system

Shared helpers

Status and money types, formatters, road snapping and CSV/Excel export used by High Command components.

Free · MITLibrary@highcommand/lib4 files
See it in context
CallOutput
fmtMoney(m)$31,462
fmtMoney(m, { cents: true })$31,461.53
fmtMoney(m, { compact: true })$31,462
delayText(12)+12 min
durationText(12)12 min
ago(now − 12 min, now)12 min ago
fmtDate("2026-10-01")Oct 01
fmtDateTime(…20:00Z, "America/Chicago")Oct 01 15:00 CDT
snapToRoad(route R-07, near UT)14.84 km along · 129 m off
Export · 4 rows
Shipment,Customer,Promised,Slip (min),Order value
SHP-48213,Atlas Foods Co.,2026-10-02,34,48210
SHP-48245,Summit Auto Parts,2026-10-03,12,31440
SHP-48251,'=Harbor & Pine,2026-10-03,0,18620.5
SHP-48260,"Bluestem Packaging, Inc.",2026-10-04,-5,3120.5

The CSV is what Export writes: amounts as plain dollars, dates ISO, a comma-holding name quoted, and the formula-looking customer prefixed with ' so a spreadsheet never runs it.

Installation

$ npx shadcn@latest add @highcommand/lib

Copies the source into your project and pulls in what it needs. First time? Add the registry to components.json.

API

31 functions
  • delayText(min: number | null): string

    Delay in words: "+12 min" behind plan, "-3 min" ahead, "On plan".

  • durationText(min: number): string

    "2 h 05 min", "45 min", "0 min".

  • fmtMoney(m: MoneyJson, o?: { cents?: boolean | undefined; compact?: boolean | undefined; }): string

    Money on the wire is a decimal string of minor units; never a float. Without cents it rounds half up to whole dollars.

  • fmtSV(v: string | number | MoneyJson | null, o?: { cents?: boolean | undefined; compact?: boolean | undefined; }): string

    A SourcedValue's value as text: "—" for null, an integer with commas, other numbers to one decimal, a string as is, money through `fmtMoney` (`cents`: show cents; `compact`: $1.23M / $450k from $100,000 up).

  • fmtDate(iso: string | null | undefined): string

    A calendar date as "Oct 01" (month and day, read in UTC so a date-only string never shifts a day); "—" when empty.

  • zoneAbbr(d: Date, timeZone?: string | undefined): string

    The viewer's time zone abbreviation at that instant ("EDT", "PST"; "GMT+2" where the zone has none).

  • fmtDateTime(iso: string | null | undefined, timeZone?: string | undefined): string

    An instant in the viewer's own time zone, with the zone named: "Oct 01 20:00 EDT". Business dates (due dates, promised dates) are calendar days and go through fmtDate instead. `timeZone` is for tests.

  • fmtClock(iso: string): string

    The simulated clock: the simulated day is a UTC day (due dates turn past due at UTC midnight), so the clock reads UTC and says so.

  • ago(iso: string | null, nowIso: string): string

    How long ago (or ahead) `iso` is from `nowIso`, as a phrase: "just now", "12 min ago", "3 h ago", "2 days ago", "in 3 days". Both are simulated instants when the caller passes the simulated clock.

  • agoShort(iso: string | null, nowIso: string): string

    The compact form for narrow columns: "now", "12m", "3h", "2d".

  • isMoney(v: unknown): v is MoneyJson

    True for a money object on the wire (has `amount_minor` and `currency`).

  • moneyNumber(m: MoneyJson): number

    Money as a JS number of dollars (minor units / 100); fine for charts and sorting, not for arithmetic you display.

  • fmtTime(iso: string | null | undefined, timeZone?: string | undefined): string

    Time of day in the viewer's zone: "20:00 EDT".

  • hhmm(ms: number): string

    Epoch ms as local 24-hour "HH:MM" ("09:30", midnight "00:05").

  • titleCase(s: string): string

    "past_due" becomes "Past due": underscores to spaces, first letter capitalised.

  • haversineM(a: readonly [number, number], b: readonly [number, number]): number

    Great-circle distance in metres between two [lng, lat] points.

  • roadPath(pts: [number, number][]): RoadPath

    Wraps [lng, lat] points as a RoadPath with the running metres at each point and the total length.

  • pointAlong(p: RoadPath, d: number): [number, number]

    The point `d` metres along the road (clamped to its ends).

  • snapToRoad(p: RoadPath, q: readonly [number, number], fromM?: number, toM?: number): Snap | null

    The nearest point of the road to `q`, searched between `fromM` and `toM` metres along it (the whole road by default). Segment by segment on a local flat projection: exact enough for the tens of metres that decide a match.

  • sliceRoad(p: RoadPath, aM: number, bM: number): [number, number][]

    The road between two distances along it (in either order, so a truck that backs up still draws), as [lng, lat] points.

  • endpointKey(lat: number, lng: number): string

    "lat,lng" rounded to 4 decimals.

  • pathKey(from: { lat: number; lng: number; }, to: { lat: number; lng: number; }): string

    The key of the road from one endpoint to the other.

  • rawOf(kind: ExportKind, v: ExportValue): string | number | null

    The value a cell holds: a number, a date (ISO string kept for its kind), text, or empty.

  • toCsv(t: ExportTable): string

    CSV with a UTF-8 byte-order mark (Excel opens it as UTF-8), CRLF line ends. Dates stay ISO (2026-10-01, 2026-10-01T14:00:00Z).

  • toXlsx(t: ExportTable): Uint8Array<ArrayBufferLike>

    The table as an .xlsx workbook (one sheet named after the table, with an autofilter on the header row), built with no library.

  • crc32(b: Uint8Array<ArrayBufferLike>): number

    CRC-32 (the zip checksum) of the bytes.

  • zipStore(entries: [string, Uint8Array<ArrayBufferLike>][]): Uint8Array<ArrayBufferLike>

    A zip archive of the given [name, bytes] entries, stored without compression and with a fixed timestamp so the same input gives the same bytes.

  • download(t: ExportTable, format: "csv" | "xlsx", asOf?: string | undefined): string

    Saves the table in the browser as a .csv or .xlsx file named from the table and `asOf` (see `fileBase`); returns the file name. Browser only.

  • dollars(v: { amount_minor: string; }): number

    Dollars as a number, exact to the cent (amounts are integer cents on the wire).

  • excelSerial(iso: string): number | null

    A date or date-time as an Excel serial day number (UTC, as every time on screen).

  • fileBase(name: string, asOf?: string | undefined): string

    "AR past due 2026-10-01": a file name from the table's name and the as-of date, safe on every system.

Dependencies

npm
None beyond React
Builds on
Nothing else in the kit
Used by
Map geometryMapSourced valueKey-figure tileFigure groupPart barBand sparklineChart kitPop barWaterfall cascadeTime and trip modelsTime controlStage rowZones modelGeofence layerService ringsDensity heatmap
Pro pieces built on this
KPI strip ProMargin charts Pro13-week cash ladder ProWork table ProField rail ProHorizon grid ProEvent field ProIn-transit rows ProImpact line ProActivity bar ProPlayback overlay ProTrip timetable ProWeek cursor ProApp shell ProOps model ProAttention queue ProMorning brief ProShift handover ProLane panel ProOwn-fleet parts ProAgent action bar ProCustomizable dashboard ProCommand center ProFleet ProDispatch model ProGeofence draw ProJob queue ProAssign dialog ProStop list ProCustomer tracking ProField service Pro

Install this free piece now; the Pro pieces drop in on top of it, in the same app. Pro is $79 once.

PreviousThemeNext UI primitives

On this page

PreviewInstallationAPIDependencies