8-bit game-hero1
8bitcn/game-hero1FreeBlock
Health bar hero with progress indicator.
Install it
npx shadcn@latest add https://www.8bitcn.com/r/game-hero1.jsonSource
1import Link from "next/link";23import { cn } from "@/lib/utils";45import { Badge } from "@/components/ui/8bit/badge";6import { Button } from "@/components/ui/8bit/button";7import { Progress } from "@/components/ui/8bit/progress";89import "@/components/ui/8bit/styles/retro.css";1011interface GameHero1Props {12 actions?: Array<{13 href?: string;14 label: string;15 variant?: "default" | "destructive" | "ghost" | "outline" | "secondary";16 }>;17 className?: string;18 description?: string;19 xpLabel?: string;20 xpValue?: number;21 subtitle?: string;22 title: string;23}2425export default function GameHero1({26 title = "LAUNCH SEQUENCE INITIATED",27 subtitle = "v2.0 — Now Live",28 description = "Your product is ready for battle. Ship it before the competition respawns.",29 actions = [30 { label: "DEPLOY NOW", variant: "default", href: "/docs" },31 { label: "VIEW ARSENAL", variant: "outline", href: "/v2" },32 ],33 xpLabel = "XP to Next Level",34 xpValue = 72,35 className,36}: GameHero1Props) {37 return (38 <section39 className={cn("relative w-full px-4 py-16 md:py-24", className)}40 >41 <div className="mx-auto max-w-2xl text-center">42 {subtitle && (43 <div className="mb-6">44 <Badge >{subtitle}</Badge>45 </div>46 )}4748 <h1 className="retro mb-4 font-bold text-3xl tracking-tight md:text-5xl">49 {title}50 </h1>5152 {description && (53 <p className="mx-auto mb-8 max-w-lg text-muted-foreground retro text-[9px] leading-relaxed">54 {description}55 </p>56 )}5758 {actions.length > 0 && (59 <div className="mb-8 flex flex-wrap justify-center gap-4">60 {actions.map((action) =>61 action.href ? (62 <Button asChild key={action.label} variant={action.variant}>63 <Link href={action.href}>{action.label}</Link>64 </Button>65 ) : (66 <Button key={action.label} variant={action.variant}>67 {action.label}68 </Button>69 ),70 )}71 </div>72 )}7374 {/* Health bar */}75 <div className="mx-auto max-w-sm">76 <div className="retro mb-2 flex justify-between text-[10px]">77 <span>{xpLabel}</span>78 <span>{xpValue}%</span>79 </div>80 <Progress className="h-3" value={xpValue} />81 </div>82 </div>83 </section>84 );85}
What it pulls in
Other registry items
Files it writes
More from 8bitcn
All 121 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| 8-bit Advanced 1advanced1 | 8bitcn | Blocks | Free | no deps · 3 files | |
| 8-bit Advanced 2advanced2 | 8bitcn | Blocks | Free | no deps · 5 files | |
| 8-bit Advanced 3advanced3 | 8bitcn | Blocks | Free | no deps · 6 files | |
| 8-bit Audio Settingsaudio-settings | 8bitcn | Blocks | Free | 2 deps · 7 files | |
| 8-bit Chapter Introchapter-intro | 8bitcn | Blocks | Free | no deps · 3 files | |
| 8-bit Character Sheetcharacter-sheet | 8bitcn | Blocks | Free | no deps · 9 files | |
| 8-bit Chartchart | 8bitcn | Blocks | Free | no deps · 3 files | |
| 8-bit Chart Area Stepchart-area-step | 8bitcn | Blocks | Free | no deps · 3 files |
