Skip to content
Calm motion: animations on this site only fade, with no movement

Achievements ​

Badges that a user earns, with the progress to the next ones

Shows the badges of a user in a grid, for a profile or a course. Earned badges are in full color. Badges not yet earned are gray, and some show how far along the user is. For one big number, use the stat.

Basic

3 of 6 earned

  • First takeRecord your first episodeEarned 2 Nov
  • Quiet roomRecord with no noise above −60 dBEarned 9 Nov
  • First guestTalk with a guest on the showEarned 14 Nov
  • Ten episodesPublish ten episodesNot earned yet
  • Every weekPublish eight weeks in a rowNot earned yet
  • Night owlPublish an episode after midnightNot earned yet
  • achievements is a list of badges. Each badge has an id, a title, an icon (an emoji or short text), and an optional description.
  • If a badge has earned, it is earned. The value is the time as text, and it shows as "Earned 14 Nov".
  • A badge that is not earned can have progress as [now, goal]. It shows a native progress bar and the two numbers.
  • An earned badge has a solid edge and a shadow. A badge that is not earned has a dashed edge and says "Not earned yet". The state does not rest on the color.
  • The line at the top counts the earned badges. Change the words with labels or a label pack: title, locked, and the functions earned and count.

Usage ​

ts
import { BlessAchievements } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
achievements*BlessAchievement[]—
labelsPartial<{ title: string; earned: (when: string) => string; locked: string; count: (earned: number, total: number) => string; }>—

Released under the MIT License. Character names and artwork belong to their owners.