UIPin
ComponentsIconsIllustrationsMotionTemplatesApps
Boards
UIPin

Free, open-source UI components, icons, illustrations, motion, templates and apps, in one search. Every item links to its source and licence.

UIPin is free. If it saved you time, you can keep it running:

Buy me a coffee
ComponentsIconsIllustrationsMotionTemplatesAppsLibrariesCompareNew this weekMCP for agentsBoardsPrivacy

Components, icons and artwork belong to their authors and are shown under their open-source licences.

8bitcn/8-bit XP Bar

Feedback & loaders
1 of 5
Compiling

Theme it

Every preview, live

Brand colour

Corner radius

Font

Recolours shadcn’s tokens, Tailwind’s accent colours and colours set in the code. Red, amber and green classes stay, since they usually mean error, warning or success.

5 versions·3 libraries

  • 8-bit XP Bar
  • 8-bit Health Bar
  • 8-bit Mana Bar
  • Kokonut UI
  • Magic UI

8-bit XP Bar

A simple 8-bit XP bar component with level up animation

npx shadcn@latest add https://www.8bitcn.com/r/xp-bar.json
Open in v0 Docs Repo
Library
8bitcn
License
MIT
Stack
React · Tailwind CSS
Size
174 lines
Demo
Written by UIPin: the library doesn’t ship a usage example, so the preview uses one of ours (in the code below).

Code

components/ui/8bit/xp-bar.tsx

import { type BitProgressProps, Progress } from "@/components/ui/8bit/progress";
import { cn } from "@/lib/utils";

interface XpBarProps extends React.ComponentProps<"div"> {
  className?: string;
  props?: BitProgressProps;
  variant?: "retro" | "default";
  value?: number;
  levelUpMessage?: string;
}

export default function XpBar({
  className,
  variant,
  value,
  levelUpMessage = "LEVEL UP!",
  ...props
}: XpBarProps) {
  const isLevelUp = value === 100;

  return (
    <div className={cn("relative", className)}>
      <Progress
        {...props}
        value={value}
        variant={variant}
        className={cn(isLevelUp && "animate-pulse")}
        progressBg="bg-yellow-500"
      />
      {isLevelUp && (
        <div
          className={cn(
            "retro",
            "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",
            "text-[0.625rem] text-black",
            "pointer-events-none whitespace-nowrap z-10",
            "drop-shadow-[1px_1px_0_#fff] [text-shadow:1px_1px_0_#fff,-1px_-1px_0_#fff,1px_-1px_0_#fff,-1px_1px_0_#fff]",
            "animate-[blink_0.5s_step-end_infinite]"
          )}
        >
          {levelUpMessage}
        </div>
      )}
      <style>{`
        @keyframes blink {
          0%, 100% { opacity: 1; }
          50% { opacity: 0; }
        }
      `}</style>
    </div>
  );
}

More like this

8-bit Slider

8bitcn·Inputs & forms

8-bit Health Bar

8bitcn·Feedback & loaders

8-bit Mana Bar

8bitcn·Feedback & loaders

8-bit Progress

8bitcn·Feedback & loaders

8-bit Textarea

8bitcn·Text effects

Card Nav

React Bits·NavigationMIT+

Ribbons

React Bits·Cursor & effectsMIT+

Animated Grid Pattern

Magic UI·Backgrounds

Drape Background

Kokonut UI·Backgrounds

Border Trail

Motion Primitives·Cursor & effects

Carousel

HextaUI·Media & 3D

Side Panel

Cult UI·Other

Grid Pattern

Magic UI·Backgrounds

Safari

Magic UI·Media & 3D

Fuzzy Text

React Bits·Text effectsMIT+