badge
fulldev-ui/badgeFreeComponent
fulldev/ui publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by fulldev/ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://ui.full.dev/r/badge.jsonSource
1import { cva, type VariantProps } from "class-variance-authority"23export const badgeVariants = cva(4 "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:ring-[3px] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:pointer-events-none [&>svg]:size-3!",5 {6 variants: {7 variant: {8 default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",9 secondary:10 "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",11 destructive:12 "bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20",13 outline:14 "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",15 ghost:16 "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",17 link: "text-primary underline-offset-4 hover:underline",18 },19 },20 defaultVariants: {21 variant: "default",22 },23 }24)2526export type BadgeVariantProps = VariantProps<typeof badgeVariants>
Files it writes
More from fulldev/ui
All 144 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | fulldev/ui | Components | Free | 1 dep · 5 files | |
| alertalert | fulldev/ui | Components | Free | no deps · 5 files | |
| alert-dialogalert-dialog | fulldev/ui | Components | Free | 1 dep · 13 files | |
| avataravatar | fulldev/ui | Components | Free | no deps · 7 files | |
| bannerbanner | fulldev/ui | Components | Free | no deps · 3 files | |
| breadcrumbbreadcrumb | fulldev/ui | Components | Free | no deps · 8 files | |
| buttonbutton | fulldev/ui | Components | Free | no deps · 3 files | |
| cardcard | fulldev/ui | Components | Free | no deps · 8 files |
