BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/8bitcn/alert

8-bit Alert

8bitcn/alert
FreeComponent

A simple 8-bit switch component

Install it

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

Source

components/ui/8bit/alert.tsxwww.8bitcn.com/r/alert.json
1import { type VariantProps, cva } from "class-variance-authority";
2
3import { cn } from "@/lib/utils";
4
5import {
6 Alert as ShadcnAlert,
7 AlertDescription as ShadcnAlertDescription,
8 AlertTitle as ShadcnAlertTitle,
9} from "@/components/ui/alert";
10
11export const alertVariants = cva("", {
12 variants: {
13 font: {
14 normal: "",
15 retro: "retro",
16 },
17 variant: {
18 default: "bg-card text-card-foreground",
19 destructive:
20 "text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",
21 },
22 },
23 defaultVariants: {
24 variant: "default",
25 },
26});
27
28export interface BitAlertProps
29 extends React.ComponentProps<"div">,
30 VariantProps<typeof alertVariants> {}
31
32function Alert({ children, className, font, variant, ...props }: BitAlertProps) {
33 return (
34 <div className="relative">
35 <ShadcnAlert
36 {...props}
37 variant={variant}
38 className={cn(
39 "relative rounded-none border-none bg-background",
40 font !== "normal" && "retro",
41 className
42 )}
43 >
44 {children}
45 </ShadcnAlert>
46
47 <div className="absolute -top-1.5 w-1/2 left-1.5 h-1.5 bg-foreground dark:bg-ring" />
48 <div className="absolute -top-1.5 w-1/2 right-1.5 h-1.5 bg-foreground dark:bg-ring" />
49 <div className="absolute -bottom-1.5 w-1/2 left-1.5 h-1.5 bg-foreground dark:bg-ring" />
50 <div className="absolute -bottom-1.5 w-1/2 right-1.5 h-1.5 bg-foreground dark:bg-ring" />
51 <div className="absolute top-0 left-0 size-1.5 bg-foreground dark:bg-ring" />
52 <div className="absolute top-0 right-0 size-1.5 bg-foreground dark:bg-ring" />
53 <div className="absolute bottom-0 left-0 size-1.5 bg-foreground dark:bg-ring" />
54 <div className="absolute bottom-0 right-0 size-1.5 bg-foreground dark:bg-ring" />
55 <div className="absolute top-1.5 -left-1.5 h-1/2 w-1.5 bg-foreground dark:bg-ring" />
56 <div className="absolute bottom-1.5 -left-1.5 h-1/2 w-1.5 bg-foreground dark:bg-ring" />
57 <div className="absolute top-1.5 -right-1.5 h-1/2 w-1.5 bg-foreground dark:bg-ring" />
58 <div className="absolute bottom-1.5 -right-1.5 h-1/2 w-1.5 bg-foreground dark:bg-ring" />
59 </div>
60 );
61}
62
63function AlertTitle({
64 className,
65 ...props
66}: React.HTMLAttributes<HTMLDivElement>) {
67 return (
68 <ShadcnAlertTitle
69 className={cn("line-clamp-1 font-medium tracking-tight", className)}
70 {...props}
71 />
72 );
73}
74
75function AlertDescription({
76// … truncated

What it pulls in

Other registry items

  • alert

Files it writes

  • components/ui/8bit/alert.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
today

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 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 Buttonbutton8bitcnComponentsFreeno 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