Gantt, StatTile, BarList, PaginationPages and TreeView
A roadmap, metric tiles, a ranked list, pages, nested rows
- A roadmap or a schedule is
Gantt. A timeline of dated bars (projects, phases, releases) on a grid of weeks, months or quarters, grouped by team, with a today line; never a grid of bars by hand. A bar opens its record (onClick) or links to it (href,asChildfor a router's link) and shows itsprogress; the zoom switch goes in aGanttToolbar, which adds the Today button;todayLabel,markersand aGanttLegendfinish a roadmap page: never hand-build them around it. The vertical history of a record's events by day isTimeline.EXAMPLES.md, "Gantt", has the example. - A metric tile is
StatTile, a row of themStatGroup. A title, the big figure, its change with what it compares with, and a sub-line with a sparkline at the foot:<StatTile label="Active members" value="1,284" trend={<TrendChip value={6} />} comparison="vs prior 30 days" description="52 joined" spark={<Sparkline values={run} label="…" />} />, never a Card, a Stat and a chip put together by hand. HandTrendChipthe change as a number (value;good="down"where a fall is good, as for churn;good="neither"for a change that is neither good nor bad, as for conversations received;flatBelowfor a move too small to count): it picks the arrow, its colour, the sign and the words.EXAMPLES.md, "Stat", has the row. - A ranked list of shares is
BarList. Top pages, revenue by plan, tickets by team:<BarList aria-label="Top pages" items={[{ label: '/pricing', value: 1240, href: '/pricing' }, …]} limit={5} />sorts largest first, scales each bar to the largest value (ormax), formats the figures (format:Intl.NumberFormatoptions or a function) and counts the rest in "+N more"; never bars out ofdivs with widths of your own. A row'shueis its bar's colour (a team's); a router's link is<BarListItem label value asChild><Link … /></BarListItem>.EXAMPLES.md, "BarList", has the example. - Pages of a long list are
PaginationPages.<Pagination><PaginationPages page={page} pageCount={count} href={(n) => '?page=' + n} onPageChange={setPage} /></Pagination>works out which pages to show (first, last, the page shown with its neighbours, a gap for the rest) and switches Previous and Next off at the ends; never a page list of your own.EXAMPLES.md, "Pagination", has the example. A table that can outgrow one screen (the person adds rows, or it starts with more than 25) ends in that footer, thePaginationitself under the table:className="flex flex-wrap items-center gap-x-6 gap-y-3 py-4 px-6"(px-6the page gutter), holding the rows shown (<p className="text-sm text-muted-foreground tabular-nums whitespace-nowrap">11–20 of 24</p>), then "Rows per page" (its words and aSelectwithSelectTrigger size="sm": 10, 25, 50), then<PaginationPages className="grow basis-96 justify-end" …/>; a search, a filter or a new page size starts it again on page 1. - Nested rows to open and pick from are
TreeView. Teams and projects, folders and files, pages under pages:<TreeView aria-label="Projects" items={[{ id, label, icon, children: […] }]} />draws the rows, their chevrons, levels and the keys (arrows, Home, End, a typed letter,*); never nested lists or collapsibles of your own.value/onValueChangehold the chosen row's id;type="multiple"ticks several (their ids);hasChildrenwithonLoadChildrenloads a row's rows when it opens.EXAMPLES.md, "TreeView", has the example.