Badge
edgecom/badgeFreeComponent
The Edgecom Badge component.
Live preview
live · rendered by the registry
Rendered by edgecom on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://design.edgecom.ai/r/badge.jsonSource
1import { mergeProps } from "@base-ui/react/merge-props"2import { useRender } from "@base-ui/react/use-render"3import { cva, type VariantProps } from "class-variance-authority"45import { cn } from "@/lib/utils"67const badgeVariants = cva(8 "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:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",9 {10 variants: {11 variant: {12 default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",13 secondary:14 "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",15 destructive:16 "bg-destructive/10 text-destructive-emphasis focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",17 success:18 "bg-success/10 text-success-emphasis focus-visible:ring-success/20 dark:focus-visible:ring-success/40 [a]:hover:bg-success/20",19 warning:20 "bg-warning/10 text-warning-emphasis focus-visible:ring-warning/20 dark:focus-visible:ring-warning/40 [a]:hover:bg-warning/20",21 info: "bg-info/10 text-info-emphasis focus-visible:ring-info/20 dark:focus-visible:ring-info/40 [a]:hover:bg-info/20",22 electricity:23 "bg-chart-electricity-500/10 text-chart-electricity-700 focus-visible:ring-chart-electricity-500/20 dark:text-chart-electricity-300 [a]:hover:bg-chart-electricity-500/20",24 water:25 "bg-chart-water-500/10 text-chart-water-700 focus-visible:ring-chart-water-500/20 dark:text-chart-water-300 [a]:hover:bg-chart-water-500/20",26 gas: "bg-chart-gas-500/10 text-chart-gas-700 focus-visible:ring-chart-gas-500/20 dark:text-chart-gas-300 [a]:hover:bg-chart-gas-500/20",27 temperature:28 "bg-chart-temperature-500/10 text-chart-temperature-700 focus-visible:ring-chart-temperature-500/20 dark:text-chart-temperature-300 [a]:hover:bg-chart-temperature-500/20",29 emissions:30 "bg-chart-emissions-500/10 text-chart-emissions-700 focus-visible:ring-chart-emissions-500/20 dark:text-chart-emissions-300 [a]:hover:bg-chart-emissions-500/20",31// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from edgecom
All 66 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | edgecom | Components | Free | 2 deps | |
| Alertalert | edgecom | Components | Free | 1 dep | |
| Alert Dialogalert-dialog | edgecom | Components | Free | 1 dep | |
| Avataravatar | edgecom | Components | Free | 1 dep | |
| Bannerbanner | edgecom | Components | Free | 1 dep | |
| Breadcrumbbreadcrumb | edgecom | Components | Free | 2 deps | |
| Buttonbutton | edgecom | Components | Free | 2 deps | |
| Button Groupbutton-group | edgecom | Components | Free | 2 deps |
