Skip to contentVibraUI

Reps by bookings

Closed-won value by rep over the last months, ranked; reads repLeaderboard().

Preview

Install

npx shadcn@latest add @vibra/widget-ecommerce-sales-reps-leaderboard

Needs the @vibra registry in your components.json — set it up once.

Source

app/ecommerce/sales/components/reps-leaderboard.tsx
"use client"

import { formatCurrency } from "@/lib/format"
import { RankList } from "@/components/ui/rank-list"
import { Widget } from "@/components/ui/widget"

const money = (value: number) => formatCurrency(value, "USD", { maximumFractionDigits: 0 })

export type RepsLeaderboardProps = {
  rows: { label: string; value: number }[]
  months: number
}

/** Who closed what: every deal credits the rep who owns the account behind it. */
export function RepsLeaderboard({ rows, months }: RepsLeaderboardProps) {
  return (
    <Widget
      data-widget="widget-ecommerce-sales-reps-leaderboard"
      title="Reps by bookings"
      description={`Closed-won value, last ${months} months`}
      className="h-full"
    >
      <RankList items={rows} showRank color="chart-2" format={money} />
    </Widget>
  )
}

Its page

On its page the card sits among the rest of the dashboard and shares its range and its data with them.

From the Sales dashboard page