Documentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/retro-cosmic-arcade/llms.txt
Use this file to discover all available pages before exploring further.
PixelHPBar renders a horizontal progress bar divided into 20 discrete segments, styled to look like the HP (hit-point) bar in a classic 8-bit or 16-bit RPG. Filled segments glow neon lime; empty segments are dark. A text label sits on the left and the numeric percentage floats right-aligned. The component is ideal for skills sections, profile pages, or any context where you want to visualize a proficiency level in a retro-game style.
Props
The skill or category name displayed to the left of the bar. Rendered in
text-y2k-cyan font-vt323 text-xl with a fixed w-32 width, so labels longer than roughly 10–12 characters may wrap or overflow. Keep labels short and uppercase for best results.An integer between
0 and 100 (inclusive) representing how full the bar should be. The filled segment count is computed as Math.round(percentage / 100 * 20). The raw percentage value is also displayed as text at the right end of the bar row.Usage
Single bar
Skills section with multiple bars
How it works
The component calculates the number of filled segments with:Array.from({ length: 20 }) array, mapping each index to a <div>. If the index is less than filledCount, the segment receives the filled style; otherwise it receives the empty style.
Segment styling
| State | Classes |
|---|---|
| Filled | bg-y2k-lime shadow-[0_0_5px_#adff2f] |
| Empty | bg-[#111] |
| Both | flex-1 mx-[1px] (even sizing with small gaps) |
Row layout
| Element | Classes |
|---|---|
| Outer row | flex items-center gap-4 font-vt323 text-xl |
| Label | w-32 text-y2k-cyan |
| Bar container | flex-grow flex border-2 border-y2k-darkSilver bg-black p-1 h-6 |
| Percentage label | w-12 text-right text-y2k-silver |
Styling notes
- Filled segment color is
y2k-lime(#adff2f). The accompanyingshadow-[0_0_5px_#adff2f]glow effect uses an arbitrary Tailwind shadow value — ensure this file is included in Tailwind’scontentpaths to avoid purging. - Label width is hard-coded at
w-32. If your labels are consistently shorter, you can pass them in all-caps to match the UI language of the rest of the component library.
Caveats
Segment count is always 20 — the granularity of the bar is therefore 5% per segment. Percentages that are not multiples of 5 are rounded to the nearest segment via
Math.round, so a value of 92 and 93 both render 18 filled segments (90%), while 93.5 and above rounds to 19 (95%).