Fleet Grid
ProNewA fleet as one cell per instance, grouped by region and colored by state. The legend counts each state and filters to it; pointing at a cell names the instance beneath the grid.
Installation
pnpm dlx shadcn@latest add @viewport/fleet-grid
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
The code behind the preview above comes with Truffle Pro.
Props
| Prop | Type | Default |
|---|---|---|
| instances* | FleetInstance[] | — |
| onSelect | (id: string) => voidCalled when an instance is pressed, e.g. to open it. | — |
| noun | stringWhat an instance is called, and its plural, e.g. "sandbox" and "sandboxes". | "instance" |
| nounPlural | string | `${noun}s` |
| className | string | — |
Accessibility
- Each cell is a button named with its ID, state and detail; arrow keys move between cells.
- Failed cells carry a notch as well as a color.
- The legend's filters are pressed-state buttons with counts.
- Starting cells pulse only when motion is allowed.