BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/8bitcn/button

8-bit Button

8bitcn/button
FreeComponent

A simple 8-bit button component

Install it

npx shadcn@latest add https://www.8bitcn.com/r/button.json

Source

components/ui/8bit/button.tsxwww.8bitcn.com/r/button.json
1import { type VariantProps, cva } from "class-variance-authority";
2import { Slot } from "radix-ui";
3import type { ButtonHTMLAttributes, Ref } from "react";
4
5import { Button as ShadcnButton } from "@/components/ui/button";
6import { cn } from "@/lib/utils";
7
8import "@/components/ui/8bit/styles/retro.css";
9
10export const buttonVariants = cva("", {
11 variants: {
12 font: {
13 normal: "",
14 retro: "retro",
15 },
16 variant: {
17 default: "bg-foreground",
18 destructive: "bg-foreground",
19 outline: "bg-foreground",
20 secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
21 ghost: "hover:bg-accent hover:text-accent-foreground",
22 link: "text-primary underline-offset-4 hover:underline",
23 },
24 size: {
25 default: "",
26 sm: "",
27 lg: "",
28 icon: "",
29 },
30 },
31 defaultVariants: {
32 variant: "default",
33 size: "default",
34 },
35});
36
37export interface BitButtonProps
38 extends ButtonHTMLAttributes<HTMLButtonElement>,
39 VariantProps<typeof buttonVariants> {
40 asChild?: boolean;
41 ref?: Ref<HTMLButtonElement>;
42}
43
44interface ButtonDecorationsProps {
45 size: BitButtonProps["size"];
46 variant: BitButtonProps["variant"];
47}
48
49function ButtonDecorations({ size, variant }: ButtonDecorationsProps) {
50 return (
51 <span
52 aria-hidden="true"
53 className="pointer-events-none contents"
54 data-slot="button-decorations"
55 >
56 {variant !== "ghost" && variant !== "link" && size !== "icon" && (
57 <>
58 {/* Pixelated border */}
59 <span className="absolute -top-1.5 left-1.5 h-1.5 w-1/2 bg-foreground dark:bg-ring" />
60 <span className="absolute -top-1.5 right-1.5 h-1.5 w-1/2 bg-foreground dark:bg-ring" />
61 <span className="absolute -bottom-1.5 left-1.5 h-1.5 w-1/2 bg-foreground dark:bg-ring" />
62 <span className="absolute -bottom-1.5 right-1.5 h-1.5 w-1/2 bg-foreground dark:bg-ring" />
63 <span className="absolute top-0 left-0 size-1.5 bg-foreground dark:bg-ring" />
64 <span className="absolute top-0 right-0 size-1.5 bg-foreground dark:bg-ring" />
65 <span className="absolute bottom-0 left-0 size-1.5 bg-foreground dark:bg-ring" />
66 <span className="absolute right-0 bottom-0 size-1.5 bg-foreground dark:bg-ring" />
67 <span className="absolute top-1.5 -left-1.5 h-[calc(100%-12px)] w-1.5 bg-foreground dark:bg-ring" />
68// … truncated

What it pulls in

Other registry items

  • button

Files it writes

  • components/ui/8bit/button.tsx
  • components/ui/8bit/styles/retro.css

Facts

Registry
8bitcn
Type
registry:component
Access
Free
Files written
2
Licence
the repository states none
First indexed
2026-08-01
Last confirmed
yesterday

Go to the source

www.8bitcn.com Raw registry item This item as JSON

More from 8bitcn

All 121 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
8-bit Accordionaccordion8bitcnComponentsFreeno deps · 2 files
8-bit Alertalert8bitcnComponentsFreeno deps · 2 files
8-bit Alert Dialogalert-dialog8bitcnComponentsFreeno deps · 2 files
8-bit Avataravatar8bitcnComponentsFreeno deps · 2 files
8-bit Badgebadge8bitcnComponentsFreeno deps · 2 files
8-bit Breadcrumbbreadcrumb8bitcnComponentsFreeno deps · 2 files
8-bit Button Groupbutton-group8bitcnComponentsFreeno deps · 4 files
8-bit Calendarcalendar8bitcnComponentsFreeno deps · 2 files
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex