# Rank climb

A leaderboard where the order is the story: rows travel to their new rank and say how far they moved.

Also called: leaderboard animation, animated leaderboard.

> chatcn Pro: needs a Pro license (https://chatcn.dev/pro). Install from the `@chatcn-pro` registry with your license token; setup at https://chatcn.dev/docs/chatcn-pro.

Example: A leaderboard where order is the story. As new scores land each model travels to its new rank, says how far it moved, and its score rolls. Preview: https://chatcn.dev/preview/rank-climb-demo

When new scores land, each row travels to its new rank, overtaking or falling behind the rows around it, and says how far it moved in a small green or red count that fades once you have seen it. Scores roll digit by digit. Rows that did not move stay perfectly still.

## Installation

```bash
npx shadcn@latest add @chatcn-pro/rank-climb
```

## Usage

```tsx
import { RankClimb } from "@/components/ui/chatcn/pro/rank-climb"

<RankClimb rows={models} unit="%" decimals={1} />
```

## Props

| Prop | Type | Notes |
| --- | --- | --- |
| `rows` | `{ id, name, score, detail? }[]` | Any order; ranked by score |
| `decimals` | `number` | Default 1 |
| `unit` | `string` | After the score: "%" |

## Accessibility

- An ordered list; the moves read as places up or places down.

## Motion

- FLIP on each row, 560 ms; climbing rows pass over the others. Reduced motion: the order just changes.

Source: https://chatcn.dev/docs/components/rank-climb