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/Figures, charts and tables

Pop bar

A stacked bar of figures whose multi-part segment lifts and unfolds a zoomed bar of its parts on hover, focus or tap; labels fit by width.

Free · MITComponent@highcommand/pop-bar3 files
See it in context
Hover or focus the thin freight slice: it lifts and its parts unfold.

Click a figure: what it would open shows here.

Customize

Installation

$ npx shadcn@latest add @highcommand/pop-bar

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

Props

<PopBar />

A stacked bar of figures: segments with parts lift out on hover, focus or tap and unfold a zoomed bar of their parts.

PropTypeDefault
segmentsrequiredPopSegment[]—

The bar's segments, in order; each is its figure's button.

labelrequiredstring—

the bar's accessible name

hintReactNode—

the quiet line under the bar at rest, under the hint segment; hidden while a segment is open

hintKeystring—

the segment the hint sits under (default: the first one that pops)

caption(seg: PopSegment) => ReactNode—

the zoomed bar's caption (default: a swatch, the segment's name, amount and share)

compactboolean—

a shorter bar (the account profile)

testidstring—

test id prefix: segments `${testid}-${key}`, the zoomed bar `${testid}-${key}-lens`, parts `${testid}-part-${key}`, hint `${testid}-hint`

classNamestring—

Extra class on the bar's root.

classAliasstring—

extra class prefix put next to every `pop-*` class (`mg-ds` gives `mg-ds-bar`, `mg-ds-seg`...), for selectors that predate PopBar

attrsRecord<string, string | undefined>—

attributes for the root (`data-testid`, `data-variant`...)

onSelect(v: SourcedValue) => void—

opens a segment's or part's records (default: the page's `CommandActionsProvider`)

Helpers11 exported functions
  • usePop(zone: string, sticky?: boolean): { state: PopState; open: boolean; mounted: boolean; show: () => void; hide: () => void; hideSoon: () => void; lastPointer: RefObject<string>; inZone: (el: EventTarget | null) => boolean…

    Open on hover or focus, close a moment after the pointer leaves (so it can travel from the slice to the parts) or focus leaves, on Escape, and on a tap outside. Closing unmounts at once; what the eye sees leave is a ghost (motion.ts), none with reduced motion.

  • segmentLabel(s: Named & { share: number; hideName?: boolean | undefined; }, px: number): LabelText

    A segment's label: the name with "amount · share", else the short name with them, else "amount · share", else the share, else nothing. `hideName`: the segment never prints its name (something next to the bar names it).

  • partLabel(p: Named, shareOfTotal: number, px: number): LabelText

    A part's label in the zoomed bar. Its share is of the whole bar (as the caption reads), and when even "amount · share" does not fit it falls back to the amount alone (the caption then names the part in full).

  • spans(segments: readonly { key: string; share: number; }[]): Span[]

    Where each drawn segment sits along the bar (0..1). Segments with no share are not drawn; the shares are normalised over the drawn ones (so shares of a figure that do not add up to 1, such as costs over revenue when the margin is negative, still fill the bar). The 2 px gaps between segments are small enough to ignore here.

  • drawnParts<P extends { share: number; }>(segShare: number, parts: readonly P[]): (P & { shareOfTotal: number; })[]

    The parts drawn in the zoomed bar (those with a share of their segment), each with its share of the whole bar.

  • popVars(span: Span | undefined): Record<"--fa" | "--fb" | "--fo" | "--fs", string | number>

    CSS variables for the open (or hint-anchoring) segment: its start, end, centre, and its width as the zoom's starting scale.

  • pctText(share: number): string

    The share as a percentage: whole points from 10%, one decimal under it.

  • fits(text: string, px: number): boolean

    Rough width of a label at 12px (Geist and Geist Mono average about 7 px a character), plus the segment's padding.

  • firstFit(options: string[], px: number): string

    The first option that fits, else nothing.

  • isPoppable(s: { share: number; parts?: readonly unknown[] | undefined; }): boolean

    A segment with two or more parts lifts and unfolds them; a segment that is not drawn (no share) never does.

  • hintSide(span: Span | undefined): "start" | "end"

    The at-rest hint runs from the segment's start, or ends at its end when the segment sits in the bar's right half.

Dependencies

npm
None beyond React
Builds on
ThemeUI primitivesShared helpersSourced value
Used by
Waterfall cascade
Pro pieces built on this
Margin charts Pro13-week cash ladder Pro

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

PreviousChart kitNext Waterfall cascade

On this page

PreviewInstallationPropsDependencies