Skip to content
InsightCharts

Search

Search guides and components

Ranked list

A ranking as a list: position, name, value and a thin in-row bar, with an optional change indicator and highlighted rows.

Use when
A top-N list where the names matter as much as the values: league tables, best and worst performers, leaderboards with a movement column. It keeps long names readable and works in a narrow column.
Avoid when
Precise visual comparison of many values or more than about 15 rows (use bar chart); several measures per entity (use data table or comparison table); rank changing over time (use bump chart).

Preview

11% of commuting trips in Paris are made by bicycle

Share of commuting trips made by bicycle, selected European cities, with change since 2019

  1. Rank 1CopenhagenDenmark49%Up +4%
  2. Rank 2AmsterdamNetherlands35%Up +1%
  3. Rank 3UtrechtNetherlands34%Up +2%
  4. Rank 4MünsterGermany31%No change 0%
  5. Rank 5AntwerpBelgium26%Up +5%
  6. Rank 6MalmöSweden25%Down −1%
  7. Rank 7BordeauxFrance13%Up +6%
  8. Rank 8ParisFrance11%Up +7%

Source: City mobility surveys · Illustrative data

Composition

Built from

The pieces ranked list renders or expects in its slots.

Atoms

1

An inline change indicator: direction arrow, signed value and an optional baseline label.

Used in

1 template uses ranked list.

Templates

1

A recurring report. It has a masthead with the report name and period, a headline that states the main change, a KPI grid with changes and sparklines, a ranked list beside one or two trend charts, an optional comparison table, short notes and a source note.

Installation

$ pnpm dlx shadcn@latest add @insightcharts/ranked-list

The CLI copies the source into your project and needs the @insightcharts registry in components.json; see installation. With the package, import it by name:

import { RankedList } from "insightcharts";

Examples

Top five, no highlight

49% of commuting trips in Copenhagen are made by bicycle

  1. Rank 1Copenhagen49%
  2. Rank 2Amsterdam35%
  3. Rank 3Utrecht34%
  4. Rank 4Münster31%
  5. Rank 5Antwerp26%

Places moved, long names, no bar

Three of the top five hospitals are in the Netherlands

  1. Rank 1Erasmus University Medical Center Rotterdam94.1Up +2
  2. Rank 2Karolinska University Hospital93.6Down −1
  3. Rank 3Amsterdam University Medical Centers92.8No change 0
  4. Rank 4Charité – Universitätsmedizin Berlin91.9Down −1
  5. Rank 5University Medical Center Utrecht90.4Up +3

Illustrative data

Props

PropTypeDefaultDescription
dataDataInputOne row per entity. Omit inside <InsightData>.
transformTransform | Transform[]Applied before ranking.
namerequiredstringField naming each entity.
valuerequiredstringField with the value that ranks them. Bars start at zero.
changestringField with a change shown at the end of each row: a number (0.12 is +12%) or a string.
changeFormatFormatSpecsigned percentFormat for numeric changes, e.g. "signed" for places moved.
upIsGoodbooleantrueWhether a positive change is good news.
detailstringField with a short secondary line under each name.
sort"desc" | "asc" | "none""desc"Order by value; none keeps the data order.
limitnumberShow only the first N rows after sorting.
highlightstring | string[]Entity names to emphasise. The other bars are drawn in grey.
barbooleantrueDraw the in-row bar.
maxnumberValue at which a bar is full. Default: the largest value shown.
formatFormatSpec"auto"Number format for the values.
titlestringThe main fact with its number, or a plain label.
subtitlestringMeasure, population and period.
sourcestringShown under the list as "Source: ...".
notestringMethod note or caveat.
themeThemeInputTheme override.
mode"auto" | "system" | "light" | "dark""auto"Colour mode.