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-badge

Achievement Badge

trophy/achievement-badge
FreeComponent

Open source React achievement badge component with locked/unlocked states, progress rings and rarity support. Use for achievement UI design and collections. 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-badge.json

Source

registry/trophy/ui/achievement-badge.tsxui.trophy.so/r/achievement-badge.json
1"use client"
2
3import * as React from "react"
4import { Trophy } from "lucide-react"
5
6import { cn } from "@/lib/utils"
7
8interface Achievement {
9 id: string
10 name: string
11 trigger: "metric" | "api" | "streak"
12 badgeUrl?: string | null
13 progress?: number
14 rarity?: number
15}
16
17interface UserAchievement extends Achievement {
18 /** ISO date when earned, or `null` if locked */
19 achievedAt: string | null
20}
21
22interface AchievementBadgeProps extends React.HTMLAttributes<HTMLDivElement> {
23 achievement: UserAchievement
24 badgeSize?: "sm" | "default" | "lg" | "xl"
25 onAchievementClick?: (achievement: UserAchievement) => void
26}
27
28const badgeSizeMap = {
29 sm: "h-12 w-12",
30 default: "h-16 w-16",
31 lg: "h-20 w-20",
32 xl: "h-28 w-28",
33} as const
34
35const iconSizeMap = {
36 sm: "h-8 w-8",
37 default: "h-10 w-10",
38 lg: "h-12 w-12",
39 xl: "h-16 w-16",
40} as const
41
42const progressRingSizeMap = {
43 sm: 72,
44 default: 88,
45 lg: 104,
46 xl: 136,
47} as const
48
49const AchievementBadge = React.forwardRef<
50 HTMLDivElement,
51 AchievementBadgeProps
52>(
53 (
54 {
55 className,
56 achievement,
57 badgeSize = "default",
58 onAchievementClick,
59 ...props
60 },
61 ref
62 ) => {
63 const isUnlocked = achievement.achievedAt !== null
64
65 const hasProgress = isUnlocked && typeof achievement.progress === "number"
66 const progress = hasProgress
67 ? Math.min(100, Math.max(0, achievement.progress ?? 0))
68 : 0
69 const hasRarity = typeof achievement.rarity === "number"
70 const rarity = hasRarity
71 ? Math.min(100, Math.max(1, Math.round(achievement.rarity ?? 1)))
72 : null
73 const ringSize = progressRingSizeMap[badgeSize]
74 const ringStrokeWidth = 4
75 const ringRadius = (ringSize - ringStrokeWidth) / 2
76 const ringCircumference = 2 * Math.PI * ringRadius
77 const ringDashoffset =
78 ringCircumference - (progress / 100) * ringCircumference
79
80 const statusLabel = isUnlocked ? "Earned" : "Locked"
81 const itemLabel = `${achievement.name} - ${statusLabel}`
82
83 return (
84 <div
85 ref={ref}
86 role={onAchievementClick ? "button" : "listitem"}
87 aria-label={onAchievementClick ? itemLabel : undefined}
88 tabIndex={onAchievementClick ? 0 : undefined}
89 onClick={() => onAchievementClick?.(achievement)}
90 onKeyDown={
91 onAchievementClick
92 ? (e) => {
93 if (e.key === "Enter" || e.key === " ") {
94 e.preventDefault()
95 onAchievementClick(achievement)
96// … truncated

What it pulls in

npm packages

  • lucide-react

Files it writes

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

Facts

Registry
trophy
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
In the index
at or before 2026-08-13
Last confirmed
today

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 Cardachievement-cardtrophyComponentsFreeno deps
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

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex