UIPin
ComponentsIconsIllustrationsMotionTemplatesApps
Boards
UIPin

Free, open-source UI components, icons, illustrations, motion, templates and apps, in one search. Every item links to its source and licence.

UIPin is free. If it saved you time, you can keep it running:

Buy me a coffee
ComponentsIconsIllustrationsMotionTemplatesAppsLibrariesCompareNew this weekMCP for agentsBoardsPrivacy

Components, icons and artwork belong to their authors and are shown under their open-source licences.

8bitcn/8-bit Checkbox

Inputs & forms
1 of 3
Compiling

Theme it

Every preview, live

Brand colour

Corner radius

Font

Recolours shadcn’s tokens, Tailwind’s accent colours and colours set in the code. Red, amber and green classes stay, since they usually mean error, warning or success.

3 versions·3 librariesCompare all checkboxes →

  • 8bitcn
  • HextaUI
  • shadcn/ui

8-bit Checkbox

A simple 8-bit checkbox component

npx shadcn@latest add https://www.8bitcn.com/r/checkbox.json
Open in v0 Docs Repo
Library
8bitcn
License
MIT
Stack
React · Tailwind CSS · radix
Packages
cnradix-ui
Also adds
checkbox
Size
72 lines

Code

components/ui/8bit/checkbox.tsx

import type * as React from "react";

import type * as CheckboxPrimitive from "@radix-ui/react-checkbox";
import { type VariantProps, cva } from "class-variance-authority";

import { cn } from "@/lib/utils";

import { Checkbox as ShadcnCheckbox } from "@/components/ui/checkbox";

import "@/components/ui/8bit/styles/retro.css";

export const checkboxVariants = cva("", {
  variants: {
    font: {
      normal: "",
      retro: "retro",
    },
  },
  defaultVariants: {
    font: "retro",
  },
});

export interface BitCheckboxProps
  extends React.ComponentProps<typeof CheckboxPrimitive.Root>,
    VariantProps<typeof checkboxVariants> {
  asChild?: boolean;
}

function Checkbox({ className, font, ...props }: BitCheckboxProps) {
  return (
    <div
      className={cn(
        "relative flex items-center justify-center border-y-6 border-foreground dark:border-ring",
        className
      )}
    >
      <ShadcnCheckbox
        className={cn(
          "rounded-none size-5 ring-0 border-none",
          font !== "normal" && "retro",
          className
        )}
        {...props}
      />

      <div
        className="absolute inset-0 border-x-6 -mx-1.5 border-foreground dark:border-ring pointer-events-none"
        aria-hidden="true"
      />
    </div>
  );
}

export { Checkbox };

More like this

8-bit Switch

8bitcn·Inputs & forms

8-bit Avatar

8bitcn·Media & 3D

Holo Card

React Bits·CardsMIT+

Family Button

Cult UI·Buttons

Bubble Menu

React Bits·BackgroundsMIT+

Input Otp

shadcn/ui·Inputs & forms

Ai Message

SmoothUI·Backgrounds

Ai Reasoning

SmoothUI·Media & 3D

Progress

shadcn/ui·Feedback & loaders

8-bit Slider

8bitcn·Inputs & forms

Sidebar

shadcn/ui·Navigation

8-bit Health Bar

8bitcn·Feedback & loaders

8-bit Mana Bar

8bitcn·Feedback & loaders

8-bit Progress

8bitcn·Feedback & loaders

Skeleton

shadcn/ui·Feedback & loaders