BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/trophy/achievement-card

Achievement Card

trophy/achievement-card
FreeComponent

React achievement card with totals, featured badges, and scrollable lists for profile and progress surfaces. Fits achievement UI examples in SaaS, consumer and community products. Open source, built on shadcn/ui + Tailwind.

Live preview

live · rendered by the registry
Rendered by trophy on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://ui.trophy.so/r/achievement-card.json

Source

registry/trophy/ui/achievement-card.tsxui.trophy.so/r/achievement-card.json
1"use client"
2
3import * as React from "react"
4
5import { cn } from "@/lib/utils"
6import { AchievementBadge } from "@/components/ui/achievement-badge"
7import { AchievementList } from "@/components/ui/achievement-list"
8import { Button } from "@/components/ui/button"
9
10interface Achievement {
11 id: string
12 name: string
13 description?: string | null
14 trigger: "metric" | "api" | "streak"
15 badgeUrl?: string | null
16 progress?: number
17 rarity?: number
18}
19
20interface UserAchievement extends Achievement {
21 achievedAt: string | null
22}
23
24interface AchievementCardProps extends React.HTMLAttributes<HTMLDivElement> {
25 achievements: UserAchievement[]
26 highlightedAchievements: UserAchievement[]
27 badgeSize?: "sm" | "default" | "lg"
28 lockedStyle?: "grayscale" | "silhouette" | "hidden"
29 onAchievementClick?: (achievement: UserAchievement) => void
30}
31
32const AchievementCard = React.forwardRef<HTMLDivElement, AchievementCardProps>(
33 (
34 {
35 className,
36 achievements,
37 highlightedAchievements,
38 badgeSize = "default",
39 lockedStyle = "grayscale",
40 onAchievementClick,
41 ...props
42 },
43 ref
44 ) => {
45 const unlockedCount = achievements.filter(
46 (a) => a.achievedAt !== null
47 ).length
48
49 return (
50 <div
51 ref={ref}
52 className={cn("bg-card rounded-2xl border p-6 shadow-sm", className)}
53 {...props}
54 >
55 <div className="text-center">
56 <p className="text-7xl font-bold tracking-tight sm:text-8xl">
57 {unlockedCount}
58 </p>
59 <p className="text-muted-foreground mt-1 text-sm font-medium">
60 Badges Unlocked
61 </p>
62 </div>
63
64 <div className="mt-10 flex items-end justify-center gap-4">
65 {highlightedAchievements.slice(0, 3).map((achievement, index) => (
66 <AchievementBadge
67 key={achievement.id}
68 achievement={achievement}
69 badgeSize="sm"
70 onAchievementClick={onAchievementClick}
71 className={cn(
72 "w-28 border-0 bg-transparent p-0 shadow-none hover:shadow-none",
73 index === 1 ? "-translate-y-2" : "translate-y-1"
74 )}
75 />
76 ))}
77 </div>
78
79 <div className="mt-10">
80 <div className="mb-3 flex items-center justify-between">
81 <h3 className="text-primary text-sm font-medium">
82 All Achievements
83 </h3>
84// … truncated

What it pulls in

Other registry items

  • achievement-badge
  • achievement-list
  • button

Files it writes

  • registry/trophy/ui/achievement-card.tsx

Facts

Registry
trophy
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-02
Last confirmed
yesterday

Go to the source

Docs on trophy ui.trophy.so trophyso/ui on GitHub Raw registry item This item as JSON

More from trophy

All 18 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Achievement Badgeachievement-badgetrophyComponentsFree1 dep
Achievement Gridachievement-gridtrophyComponentsFree2 deps
Achievement Listachievement-listtrophyComponentsFree2 deps
Achievement Unlockedachievement-unlockedtrophyComponentsFree1 dep
Leaderboard Cardleaderboard-cardtrophyComponentsFreeno deps
Leaderboard Podiumleaderboard-podiumtrophyComponentsFree2 deps
Leaderboard Rankingsleaderboard-rankingstrophyComponentsFree2 deps
Points Awardspoints-awardstrophyComponentsFree2 deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex