Skip to content
caliper ui pro docs

Repo city

A repository as a city: districts are folders, buildings are files. Footprint is size and height is how much a file changed lately, so a big quiet file and a small busy one are different at a glance. The three busiest are ember. A switch makes height size too, for the plain treemap.

Pro

Footprint is size. Height is changes in 90 days.

Choose a building, or a file from the list.

When to use

  • Finding hotspots: where a codebase changes most and where that overlaps with size.
  • Reviews and handovers that need a picture of a repository before the details.

When not to use

  • Comparing exact values across many files; use the ranked list or a table.
  • Repositories with thousands of files; roll them up into folders first.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/repo-city

Adds its 6 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

API reference

RepoCity

17 props
PropTypeDefaultDescription
label *string—Names the city for screen readers, for example "Repository activity".
files *readonly RepoFile[]—
heightRepoHeight—What the height shows. Controlled when set.
defaultHeightRepoHeight"changes"
onHeightChange((height: RepoHeight) => void)—
selectedstring | null—The selected file path, or null. Controlled when set.
defaultSelectedstring | nullnull
onSelect((path: string | null) => void)—
hotspotsnumber3How many of the busiest files are ember and called hotspots.
sizeUnitstring"lines"
changeUnitstring"changes"
periodstring"in 90 days"Said after the change count, for example "in 90 days".
statusDepthStatus"ready"
messagesDepthMessages—
onRetry(() => void)—
disabledboolean—
classNamestring—

Keyboard

←
Moves to the previous item or value.
→
Moves to the next item or value.
↑
Moves to the previous item or value.
↓
Moves to the next item or value.

Accessibility

It exposes group semantics, with aria-label, aria-hidden, aria-pressed and aria-live kept in step with state. Changes that matter are announced through a live region.

Notes for AI

Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.

/docs/components/repo-city.md

The index of every part is at /llms.txt.

More in Showpiece charts