Component packs › Questline › XP Bar

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.

XP Bar props

PropTypeDefaultDescription
xpnumber340XP into the current level. Default 340.
maxnumber500XP needed per level. Default 500.
levelnumber
tasks{ label: string; xp: number }[]Tasks that pay XP when finished.
onLevel(level: number) => void
onEarn(xp: number, total: number) => void
autoplaynumber | falseShowcase mode: finishes the next task every N ms while visible.

Methods on the ref

Use it in React

import XpBar from './XpBar';

<XpBar />

The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.

More in Questline

Good for: Gamification and reactions.