Skip to content
GitHub

Scores

Gradient list to display scores

1,000,000IHS
900,000AAA
700,000KNM
550,000XLL
90,000RSS
75,000AAA
60,000CKL
1,000ABB
import { Scores } from "@/components/ui/pxl/scores";
export default function ScoresExample() {
return (
<div className="w-full min-h-23 flex items-center justify-center">
<Scores
className="w-36"
items={[
{ avatar: "https://raw.githubusercontent.com/pxl-ui/registry/main/app/public/portraits/hero.png", description: "IHS", title: "1,000,000", },
{ avatar: "https://raw.githubusercontent.com/pxl-ui/registry/main/app/public/portraits/hero.png", description: "AAA", title: "900,000", },
{ avatar: "https://raw.githubusercontent.com/pxl-ui/registry/main/app/public/portraits/hero.png", description: "KNM", title: "700,000", },
{ avatar: "https://raw.githubusercontent.com/pxl-ui/registry/main/app/public/portraits/hero.png", description: "XLL", title: "550,000", },
{ avatar: "https://raw.githubusercontent.com/pxl-ui/registry/main/app/public/portraits/hero.png", description: "RSS", title: "90,000", },
{ avatar: "https://raw.githubusercontent.com/pxl-ui/registry/main/app/public/portraits/hero.png", description: "AAA", title: "75,000", },
{ avatar: "https://raw.githubusercontent.com/pxl-ui/registry/main/app/public/portraits/hero.png", description: "CKL", title: "60,000", },
{ avatar: "https://raw.githubusercontent.com/pxl-ui/registry/main/app/public/portraits/hero.png", description: "ABB", title: "1,000", }
]}
/>
</div>
)
}
pnpm dlx shadcn@latest add pxl-ui/registry/scores
import { Scores } from "@/components/ui/pxl/scores"
const ITEMS = [
{ description: "IHS", title: "1,000,000", avatar: "https://raw.githubusercontent.com/pxl-ui/registry/main/app/public/portraits/hero.png", },
{ description: "AAA", title: "900,000", avatar: "https://raw.githubusercontent.com/pxl-ui/registry/main/app/public/portraits/hero.png", },
{ description: "KNM", title: "700,000", avatar: "https://raw.githubusercontent.com/pxl-ui/registry/main/app/public/portraits/hero.png", },
{ description: "XLL", title: "550,000", avatar: "https://raw.githubusercontent.com/pxl-ui/registry/main/app/public/portraits/hero.png", },
{ description: "RSS", title: "90,000", avatar: "https://raw.githubusercontent.com/pxl-ui/registry/main/app/public/portraits/hero.png", },
{ description: "AAA", title: "75,000", avatar: "https://raw.githubusercontent.com/pxl-ui/registry/main/app/public/portraits/hero.png", },
{ description: "CKL", title: "60,000", avatar: "https://raw.githubusercontent.com/pxl-ui/registry/main/app/public/portraits/hero.png", },
{ description: "ABB", title: "1,000", avatar: "https://raw.githubusercontent.com/pxl-ui/registry/main/app/public/portraits/hero.png", }
]
<Scores items={ITEMS} />
High Scores
Play to climb the ladder
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/pxl/card";
import { Scores } from "@/components/ui/pxl/scores";
import { WidgetArea } from "@/components/ui/pxl/widget-area";
export default function InCardPreview() {
return (
<WidgetArea size="sm">
<Card size="lg" className="size-full">
<CardHeader>
<CardTitle>High Scores</CardTitle>
<CardDescription>Play to climb the ladder</CardDescription>
</CardHeader>
<CardContent scrollable>
<Scores
className="w-full"
items={[
{ avatar: "https://raw.githubusercontent.com/pxl-ui/registry/main/app/public/portraits/hero.png", description: "IHS", title: "1,000,000", },
{ avatar: "https://raw.githubusercontent.com/pxl-ui/registry/main/app/public/portraits/hero.png", description: "AAA", title: "900,000", },
{ avatar: "https://raw.githubusercontent.com/pxl-ui/registry/main/app/public/portraits/hero.png", description: "KNM", title: "700,000", },
{ avatar: "https://raw.githubusercontent.com/pxl-ui/registry/main/app/public/portraits/hero.png", description: "XLL", title: "550,000", },
{ avatar: "https://raw.githubusercontent.com/pxl-ui/registry/main/app/public/portraits/hero.png", description: "RSS", title: "90,000", },
{ avatar: "https://raw.githubusercontent.com/pxl-ui/registry/main/app/public/portraits/hero.png", description: "AAA", title: "75,000", },
{ avatar: "https://raw.githubusercontent.com/pxl-ui/registry/main/app/public/portraits/hero.png", description: "CKL", title: "60,000", },
{ avatar: "https://raw.githubusercontent.com/pxl-ui/registry/main/app/public/portraits/hero.png", description: "ABB", title: "1,000", }
]}
/>
</CardContent>
</Card>
</WidgetArea>
);
}