Warcraft Checkbox
warcraftcn/checkboxFreeComponent
A Warcraft-themed checkbox component with faction-specific fantasy styling
Live preview
live · rendered by the registry
Rendered by warcraftcn on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.warcraftcn.com/r/checkbox.jsonSource
1"use client";23import * as React from "react";4import { Checkbox as CheckboxPrimitive } from "radix-ui";5import { cva, type VariantProps } from "class-variance-authority";67import { cn } from "@/lib/utils";89import "@/components/ui/warcraftcn/styles/warcraft.css";1011const checkboxVariants = cva(12 "inline-flex items-center gap-3 cursor-pointer select-none fantasy mb-2 font-bold",13 {14 variants: {15 faction: {16 default: "text-yellow-800 dark:text-yellow-100",17 orc: "text-red-700 dark:text-red-100",18 elf: "text-green-700 dark:text-green-100",19 human: "text-blue-700 dark:text-blue-100",20 undead: "text-purple-700 dark:text-purple-100",21 },22 },23 defaultVariants: {24 faction: "default",25 },26 }27);2829type Faction = "default" | "orc" | "elf" | "human" | "undead";3031interface CheckboxProps32 extends Omit<33 React.ComponentProps<typeof CheckboxPrimitive.Root>,34 "children" | "asChild"35 >,36 VariantProps<typeof checkboxVariants> {37 faction?: Faction;38 children?: React.ReactNode;39}4041function Checkbox({42 faction = "default",43 children,44 className,45 disabled,46 id,47 ...props48}: CheckboxProps) {49 return (50 <label51 htmlFor={id}52 className={cn(53 checkboxVariants({ faction }),54 disabled && "opacity-50 cursor-not-allowed"55 )}56 >57 <CheckboxPrimitive.Root58 data-slot="checkbox"59 className={cn("wc-checkbox", `wc-checkbox-${faction}`, className)}60 disabled={disabled}61 id={id}62 {...props}63 >64 <CheckboxPrimitive.Indicator />65 </CheckboxPrimitive.Root>66 {children}67 </label>68 );69}7071export { Checkbox, checkboxVariants };72export type { CheckboxProps, Faction };
What it pulls in
npm packages
Files it writes
More from warcraftcn
All 16 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Warcraft Accordionaccordion | warcraftcn | Components | Free | 1 dep · 7 files | |
| Warcraft Avataravatar | warcraftcn | Components | Free | no deps · 7 files | |
| Warcraft Badgebadge | warcraftcn | Components | Free | no deps · 4 files | |
| Warcraft Buttonbutton | warcraftcn | Components | Free | no deps · 6 files | |
| Warcraft Cardcard | warcraftcn | Components | Free | no deps · 3 files | |
| Warcraft Cursorcursor | warcraftcn | Components | Free | no deps · 6 files | |
| Warcraft Dropdown Menudropdown-menu | warcraftcn | Components | Free | 2 deps · 3 files | |
| Warcraft Inputinput | warcraftcn | Components | Free | no deps · 3 files |
