8-bit Character Sheet
8bitcn/character-sheetFreeBlock
A comprehensive RPG character stats page with attributes, equipment, and customizable sections.
Install it
npx shadcn@latest add https://www.8bitcn.com/r/character-sheet.jsonSource
1import type * as React from "react";23import { type VariantProps, cva } from "class-variance-authority";45import { cn } from "@/lib/utils";67import {8 Avatar,9 AvatarFallback,10 AvatarImage,11} from "@/components/ui/8bit/avatar";12import { Badge } from "@/components/ui/8bit/badge";13import { Card, CardContent, CardHeader } from "@/components/ui/8bit/card";14import HealthBar from "@/components/ui/8bit/health-bar";15import ManaBar from "@/components/ui/8bit/mana-bar";16import { Progress } from "@/components/ui/8bit/progress";17import { Separator } from "@/components/ui/8bit/separator";18import "@/components/ui/8bit/styles/retro.css";1920export interface PrimaryAttribute {21 name: string;22 shortName: string;23 value: number;24 max?: number;25 color?: string;26}2728export interface SecondaryStat {29 name: string;30 value: number;31 max?: number;32 isPercentage?: boolean;33 icon?: React.ReactNode;34 color?: string;35}3637export interface EquipmentItem {38 slot: string;39 name: string;40 rarity?: "common" | "uncommon" | "rare" | "epic" | "legendary";41 icon?: React.ReactNode;42}4344export interface CustomSection {45 title: string;46 content: React.ReactNode;47}4849export const characterSheetVariants = cva("", {50 variants: {51 font: {52 normal: "",53 retro: "retro",54 },55 },56 defaultVariants: {57 font: "retro",58 },59});6061export interface CharacterSheetProps62 extends React.HTMLAttributes<HTMLDivElement>,63 VariantProps<typeof characterSheetVariants> {64 characterName: string;65 characterClass?: string;66 characterTitle?: string;67 characterLevel?: number;68 avatarSrc?: string;69 avatarFallback?: string;7071 primaryAttributes?: PrimaryAttribute[];7273 secondaryStats?: SecondaryStat[];7475 health?: { current: number; max: number };76 mana?: { current: number; max: number };77 experience?: { current: number; max: number };7879 equipment?: EquipmentItem[];8081 customSections?: CustomSection[];8283 showAvatar?: boolean;84 showLevel?: boolean;85 showHealth?: boolean;86 showMana?: boolean;87 showExperience?: boolean;88 showAttributes?: boolean;89 showSecondaryStats?: boolean;90 showEquipment?: boolean;91}9293const defaultPrimaryAttributes: PrimaryAttribute[] = [94 { name: "Strength", shortName: "STR", value: 10 },95 { name: "Dexterity", shortName: "DEX", value: 10 },96 { name: "Intelligence", shortName: "INT", value: 10 },97 { name: "Vitality", shortName: "VIT", value: 10 },98 { name: "Wisdom", shortName: "WIS", value: 10 },99 { name: "Charisma", shortName: "CHA", value: 10 },100// … truncated
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 Chartchart | 8bitcn | Blocks | Free | no deps · 3 files | |
| 8-bit Chart Area Stepchart-area-step | 8bitcn | Blocks | Free | no deps · 3 files | |
| 8-bit Chart Barchart-bar | 8bitcn | Blocks | Free | no deps · 3 files |
