Badge Widget

Display badges earned by a user.

Badge Widget Light
Badge Widget Dark

Quick Start


Configuration Options

Option
Type
Default
Description

apiKey

string

required

Your DotPassport API key

address

string

required

Polkadot address to display

type

'badge' | 'badges'

required

Widget type

theme

'light' | 'dark' | 'auto'

'light'

Color theme

badgeKey

string

-

Show single specific badge

maxBadges

number

6

Max badges to display

showProgress

boolean

false

Show earned dates

className

string

''

Custom CSS class

baseUrl

string

-

Custom API base URL

onLoad

() => void

-

Callback when loaded

onError

(error: Error) => void

-

Error callback


Examples

All Badges

With Earned Dates

Badge Widget with Dates

Single Badge

Limited Display

Dark Theme


React Integration


Vue Integration


Badge Tiers

Badges are displayed with tier-based styling:

Tier
Color
Description

Bronze

#CD7F32

Entry-level achievements

Silver

#C0C0C0

Intermediate achievements

Gold

#FFD700

Advanced achievements

Platinum

#E5E4E2

Expert achievements

Diamond

#B9F2FF

Legendary achievements


Event Handling


Dynamic Updates


Last updated