BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/shadcn/ui/badge

badge

yyc3-knowledge-base/badge
UnverifiedComponent

shadcn/ui publishes no description for this item.

Install it

npx shadcn@latest add https://raw.githubusercontent.com/YYC-Cube/YYC3-Knowledge-Base/main/YYC3-D/ui/apps/v4/badge.json

Source

registry/new-york-v4/ui/badge.tsxraw.githubusercontent.com/YYC-Cube/YYC3-Knowledge-Base/main/YYC3-D/ui/apps/v4/badge.json
1import * as React from "react"
2import { cva, type VariantProps } from "class-variance-authority"
3
4import { cn } from "@/lib/utils"
5
6const badgeVariants = cva(
7 "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
8 {
9 variants: {
10 variant: {
11 default:
12 "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
13 secondary:
14 "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
15 destructive:
16 "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
17 outline: "text-foreground",
18 },
19 },
20 defaultVariants: {
21 variant: "default",
22 },
23 }
24)
25
26export interface BadgeProps
27 extends React.HTMLAttributes<HTMLDivElement>,
28 VariantProps<typeof badgeVariants> {}
29
30function Badge({ className, variant, ...props }: BadgeProps) {
31 return (
32 <div className={cn(badgeVariants({ variant }), className)} {...props} />
33 )
34}
35
36export { Badge, badgeVariants }

What it pulls in

npm packages

  • @radix-ui/react-slot

Files it writes

  • registry/new-york-v4/ui/badge.tsx

Facts

Registry
shadcn/ui
Type
registry:ui
Access
Unverified
Files written
1
Licence
the repository states none
First indexed
2026-08-01
Last confirmed
yesterday

Go to the source

ui.shadcn.com YYC-Cube/YYC3-Knowledge-Base on GitHub Raw registry item This item as JSON

More from shadcn/ui

All 411 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
accordionaccordionshadcn/uiComponentsUnverified1 dep
alertalertshadcn/uiComponentsUnverifiedno deps
alert-dialogalert-dialogshadcn/uiComponentsUnverified1 dep
aspect-ratioaspect-ratioshadcn/uiComponentsUnverified1 dep
avataravatarshadcn/uiComponentsUnverified1 dep
breadcrumbbreadcrumbshadcn/uiComponentsUnverified1 dep
buttonbuttonshadcn/uiComponentsUnverified1 dep
button-groupbutton-groupshadcn/uiComponentsUnverifiedno deps
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