Component packs › Questline › XP Bar
Finish a task and its XP flies into the bar as gems; each one fills a step and crossing the line ticks the level up.
XP Bar is a progress from Questline, a component pack with 6 gamification components: Gamification components where every reward visibly travels from what earned it. Price: $2 for the whole pack.
Built with: gem flights, carry-over levels, progressbar.
Code: React and Next.js (TypeScript), Vue 3, plain HTML/CSS/JS, Tailwind CSS v4 and Motion (motion.dev). No npm packages needed. Keyboard accessible, with a reduced-motion version, in dark and light.
| Prop | Type | Default | Description |
|---|---|---|---|
xp | number | 340 | XP into the current level. Default 340. |
max | number | 500 | XP needed per level. Default 500. |
level | number | ||
tasks | { label: string; xp: number }[] | Tasks that pay XP when finished. | |
onLevel | (level: number) => void | ||
onEarn | (xp: number, total: number) => void | ||
autoplay | number | false | Showcase mode: finishes the next task every N ms while visible. |
readonly xp: numberreadonly level: numberearn(xp: number, from?: Element): void: Adds XP from an element (gems fly from it), or from the bar's own tasks area.destroy(): voidimport XpBar from './XpBar';
<XpBar />The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.
Good for: Gamification and reactions.