Components
Ranked List
Labels ranked by count, each behind a numbered badge. Pass the rows already in order; the list numbers them as given.
Installation
bunx @happlyui/cli@latest add ranked-list
Dependencies
Registry dependencies
These are automatically installed when you add this component.
happly-ui-utils
Usage
import * as RankedList from "@/components/ui/ranked-list"
<RankedList.Root
items={[{ label: "Category A", value: 3264 }]}
columnLabels={["Category", "Count"]}
/>
Examples
Default
Four rows spread evenly down the card.
Card title
<RankedList.Root items={items} columnLabels={["Category", "Count"]} />
Many rows
Rows past what the card fits scroll inside it. A long label truncates and keeps its full text in a tooltip.
Card title
<RankedList.Root items={manyItems} columnLabels={["Category", "Count"]} />
API Reference
RankedList.Root
The list and its header.
| Prop | Type | Default | Description |
|---|---|---|---|
items | { label: string; value: number }[] | - | Rows in rank order. Not sorted for you |
columnLabels | [string, string] | - | Headers over the label column and the value column |