BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/8bitcn/enemy-health-display

8-bit Enemy Health Display

8bitcn/enemy-health-display
FreeComponent

A retro-styled enemy health display component with health bar, name, and level

Install it

npx shadcn@latest add https://www.8bitcn.com/r/enemy-health-display.json

Source

components/ui/8bit/enemy-health-display.tsxwww.8bitcn.com/r/enemy-health-display.json
1import { type VariantProps, cva } from "class-variance-authority";
2
3import { cn } from "@/lib/utils";
4
5import HealthBar from "@/components/ui/8bit/health-bar";
6
7import "@/components/ui/8bit/styles/retro.css";
8
9export const enemyHealthDisplayVariants = cva("", {
10 variants: {
11 variant: {
12 default: "",
13 retro: "retro",
14 },
15 size: {
16 sm: "text-xs",
17 md: "text-sm",
18 lg: "text-base",
19 },
20 textColor: {
21 red: "text-red-500",
22 orange: "text-orange-500",
23 yellow: "text-yellow-500",
24 green: "text-green-500",
25 blue: "text-blue-500",
26 purple: "text-purple-500",
27 },
28 },
29 defaultVariants: {
30 variant: "retro",
31 size: "md",
32 textColor: "red",
33 },
34});
35
36export interface EnemyHealthDisplayProps
37 extends React.ComponentProps<"div">,
38 VariantProps<typeof enemyHealthDisplayVariants> {
39 enemyName: string;
40 level?: number;
41 currentHealth: number;
42 maxHealth: number;
43 showLevel?: boolean;
44 showHealthText?: boolean;
45 healthBarVariant?: "retro" | "default";
46 healthBarColor?: string;
47 enemyNameColor?: string;
48}
49
50export default function EnemyHealthDisplay({
51 className,
52 variant,
53 size,
54 textColor,
55 enemyName,
56 level,
57 currentHealth,
58 maxHealth,
59 showLevel = true,
60 showHealthText = true,
61 healthBarVariant = "retro",
62 healthBarColor = "bg-red-500",
63 enemyNameColor = "text-foreground",
64 ...props
65}: EnemyHealthDisplayProps) {
66 const healthPercentage = Math.max(
67 0,
68 Math.min(100, (currentHealth / maxHealth) * 100)
69 );
70 const healthText = `${currentHealth}/${maxHealth}`;
71
72 return (
73 <div
74 className={cn(
75 "relative w-full space-y-2",
76 enemyHealthDisplayVariants({ variant, size, textColor }),
77 className
78 )}
79 {...props}
80 >
81 {/* Enemy Name and Level */}
82 <div className="flex items-center justify-between">
83 <div className="flex items-center gap-2">
84 <span className={cn("font-bold", enemyNameColor)}>{enemyName}</span>
85 {showLevel && level && (
86 <span className="text-muted-foreground">Lv.{level}</span>
87 )}
88 </div>
89 {showHealthText && (
90 <span className="text-muted-foreground text-[9px]">{healthText}</span>
91 )}
92 </div>
93
94 {/* Health Bar Container */}
95 <div className="relative">
96 <HealthBar
97 value={healthPercentage}
98 variant={healthBarVariant}
99 className="w-full"
100// … truncated

Files it writes

  • components/ui/8bit/enemy-health-display.tsx
  • components/ui/8bit/health-bar.tsx
  • components/ui/8bit/progress.tsx
  • components/ui/8bit/styles/retro.css

Facts

Registry
8bitcn
Type
registry:component
Access
Free
Files written
4
Licence
the repository states none
In the index
at or before 2026-08-09
Last confirmed
today

Go to the source

www.8bitcn.com TheOrcDev/8bitcn-ui on GitHub Raw registry item This item as JSON

More from 8bitcn

All 121 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
8-bit Accordionaccordion8bitcnComponentsFreeno deps · 2 files
8-bit Alertalert8bitcnComponentsFreeno deps · 2 files
8-bit Alert Dialogalert-dialog8bitcnComponentsFreeno deps · 2 files
8-bit Avataravatar8bitcnComponentsFreeno deps · 2 files
8-bit Badgebadge8bitcnComponentsFreeno deps · 2 files
8-bit Breadcrumbbreadcrumb8bitcnComponentsFreeno deps · 2 files
8-bit Buttonbutton8bitcnComponentsFreeno deps · 2 files
8-bit Button Groupbutton-group8bitcnComponentsFreeno deps · 4 files

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex