BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/tdds/badge

Badge

tdds/badge
FreeComponent

Treasury-themed status badges

Install it

npx shadcn@latest add https://raw.githubusercontent.com/gjohnsx/ttb-label-verification/main/tdds-registry/public/r/badge.json

Source

registry/ui/badge.tsxraw.githubusercontent.com/gjohnsx/ttb-label-verification/main/tdds-registry/public/r/badge.json
1import * as React from "react"
2import { cva, type VariantProps } from "class-variance-authority"
3import { Slot } from "radix-ui"
4
5import { cn } from "@/lib/utils"
6
7const badgeVariants = cva(
8 "h-5 gap-1 rounded-[5px] border px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive overflow-hidden group/badge",
9 {
10 variants: {
11 variant: {
12 default: "bg-primary text-primary-foreground border-transparent [a]:hover:bg-primary/80",
13 secondary: "bg-secondary text-secondary-foreground border-transparent [a]:hover:bg-secondary/80",
14 destructive: "bg-destructive/10 border-transparent [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20",
15 outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
16 ghost: "border-transparent hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
17 link: "border-transparent text-primary underline-offset-4 hover:underline",
18 // Treasury themed variants with lightest bg + border
19 "treasury-primary": "bg-treasury-primary-lightest text-treasury-primary-dark border-treasury-primary",
20 "treasury-secondary": "bg-treasury-secondary-lightest text-treasury-secondary-dark border-treasury-secondary",
21 "treasury-accent": "bg-treasury-accent-lightest text-treasury-accent-dark border-treasury-accent",
22 "treasury-warning": "bg-treasury-warning-lightest text-treasury-warning-dark border-treasury-warning",
23 "treasury-base": "bg-treasury-base-lightest text-treasury-base-dark border-treasury-base",
24 },
25 },
26 defaultVariants: {
27 variant: "default",
28 },
29 }
30)
31
32function Badge({
33 className,
34 variant = "default",
35 asChild = false,
36 ...props
37}: React.ComponentProps<"span"> &
38 VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
39 const Comp = asChild ? Slot.Root : "span"
40
41 return (
42 <Comp
43 data-slot="badge"
44 data-variant={variant}
45 className={cn(badgeVariants({ variant }), className)}
46 {...props}
47 />
48 )
49}
50
51// … truncated

What it pulls in

npm packages

  • class-variance-authority

Other registry items

  • utils

Files it writes

  • registry/ui/badge.tsx

Facts

Registry
tdds
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-02
Last confirmed
today

Go to the source

icy-river-012b1601e.6.azurestaticapps.net gjohnsx/ttb-label-verification on GitHub Raw registry item This item as JSON

More from tdds

All 43 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
AccordionaccordiontddsComponentsFree2 deps
AlertalerttddsComponentsFree1 dep
Alert Dialogalert-dialogtddsComponentsFree1 dep
AvataravatartddsComponentsFree1 dep
BreadcrumbbreadcrumbtddsComponentsFree2 deps
ButtonbuttontddsComponentsFree2 deps
Button Groupbutton-grouptddsComponentsFree1 dep
CardcardtddsComponentsFreeno 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