8-bit Checkbox
8bitcn/checkboxFreeComponent
A simple 8-bit checkbox component
Install it
npx shadcn@latest add https://www.8bitcn.com/r/checkbox.jsonSource
1import type * as React from "react";23import type * as CheckboxPrimitive from "@radix-ui/react-checkbox";4import { type VariantProps, cva } from "class-variance-authority";56import { cn } from "@/lib/utils";78import { Checkbox as ShadcnCheckbox } from "@/components/ui/checkbox";910import "@/components/ui/8bit/styles/retro.css";1112export const checkboxVariants = cva("", {13 variants: {14 font: {15 normal: "",16 retro: "retro",17 },18 },19 defaultVariants: {20 font: "retro",21 },22});2324export interface BitCheckboxProps25 extends React.ComponentProps<typeof CheckboxPrimitive.Root>,26 VariantProps<typeof checkboxVariants> {27 asChild?: boolean;28}2930function Checkbox({ className, font, ...props }: BitCheckboxProps) {31 return (32 <div33 className={cn(34 "relative flex items-center justify-center border-y-6 border-foreground dark:border-ring",35 className36 )}37 >38 <ShadcnCheckbox39 className={cn(40 "rounded-none size-5 ring-0 border-none",41 font !== "normal" && "retro",42 className43 )}44 {...props}45 />4647 <div48 className="absolute inset-0 border-x-6 -mx-1.5 border-foreground dark:border-ring pointer-events-none"49 aria-hidden="true"50 />51 </div>52 );53}5455export { Checkbox };
What it pulls in
Other registry items
Files it writes
More from 8bitcn
All 121 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| 8-bit Accordionaccordion | 8bitcn | Components | Free | no deps · 2 files | |
| 8-bit Alertalert | 8bitcn | Components | Free | no deps · 2 files | |
| 8-bit Alert Dialogalert-dialog | 8bitcn | Components | Free | no deps · 2 files | |
| 8-bit Avataravatar | 8bitcn | Components | Free | no deps · 2 files | |
| 8-bit Badgebadge | 8bitcn | Components | Free | no deps · 2 files | |
| 8-bit Breadcrumbbreadcrumb | 8bitcn | Components | Free | no deps · 2 files | |
| 8-bit Buttonbutton | 8bitcn | Components | Free | no deps · 2 files | |
| 8-bit Button Groupbutton-group | 8bitcn | Components | Free | no deps · 4 files |
