UI Kit

Leaderboard Page

Interactive preview for the @agg-build/ui LeaderboardPage surface

Leaderboard Page

LeaderboardPage ranks your app's traders by realized P&L or volume over a preset period (24h, 7d, 30d, all time). Identity fields (username, avatar, wallet) follow the app's leaderboardIdentity setting, which defaults to anonymous.

Rankings are GET /leaderboard. See Portfolio and Trader leaderboard.

Use Storybook as the source of truth for controls, layout states, and composition details.

Import

import "@agg-build/ui/styles.css";
import { LeaderboardPage } from "@agg-build/ui/pages";

Requires <AggProvider> from @agg-build/hooks.

Props

PropDescription
period, onPeriodChangeControlled preset: "1d" | "7d" | "30d" | "all"
metric, onMetricChangeControlled sort: "realizedPnl" | "volume"
rows, isLoading, error, hasNextPage, onLoadMore, isLoadingMoreSupply your own data instead of the built-in useLeaderboard hook
currentUserIdRow to highlight as "You" (defaults to the signed-in user)
appNameShown in the subtitle
onErrorCalled with render errors caught by the page's error boundary
classNameExtra classes on the root element
classNamesSlot overrides: root, header, toolbar, list, row, footer

P&L is realized only (sells and settled markets, before fees) and refreshes every 5 minutes. Each row carries volume (buys and sells) and spent (buys only), so you can show either.

Preview

On this page