BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/shadcn-solidjs/badge

badge

shadcn-solidjs/badge
FreeComponent

shadcn-solidjs publishes no description for this item.

Live preview

live · rendered by the registry
Rendered by shadcn-solidjs on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://shadcn-solidjs.com/r/badge.json

Source

src/registry/ui/badge.tsxshadcn-solidjs.com/r/badge.json
1import type { PolymorphicProps } from "@kobalte/core/polymorphic";
2import { Polymorphic } from "@kobalte/core/polymorphic";
3
4import { cn } from "~/lib/utils.ts";
5import type { VariantProps } from "class-variance-authority";
6import { cva } from "class-variance-authority";
7import type { ValidComponent } from "solid-js";
8
9import { splitProps } from "solid-js";
10
11const badgeVariants = cva(
12 "h-5 gap-1 rounded-4xl border border-transparent 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! group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none",
13 {
14 variants: {
15 variant: {
16 default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
17 secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
18 destructive: "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",
19 outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
20 ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
21 link: "text-primary underline-offset-4 hover:underline",
22 },
23 },
24 defaultVariants: {
25 variant: "default",
26 },
27 },
28);
29
30type BadgeProps<T extends ValidComponent = "span"> =
31 & VariantProps<typeof badgeVariants>
32 & { class?: string | undefined };
33
34const Badge = <T extends ValidComponent = "span">(
35 props: PolymorphicProps<T, BadgeProps<T>>,
36) => {
37 const [local, others] = splitProps(props as BadgeProps, ["class", "variant"]);
38 return (
39 <Polymorphic
40 as="span"
41 data-slot="badge"
42 data-variant={local.variant ?? "default"}
43 class={cn(badgeVariants({ variant: local.variant }), local.class)}
44 {...others}
45 />
46 );
47};
48
49export type { BadgeProps };
50export { Badge, badgeVariants };

What it pulls in

npm packages

  • @kobalte/core
  • class-variance-authority

Facts

Registry
shadcn-solidjs
Type
registry:ui
Access
Free
Files written
0
Licence
MIT
In the index
at or before 2026-08-16
Last confirmed
today

Go to the source

Docs on shadcn-solidjs shadcn-solidjs.com ptzburn/shadcn-solidjs on GitHub Raw registry item This item as JSON

More from shadcn-solidjs

All 85 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
accordionaccordionshadcn-solidjsComponentsFree1 dep
alertalertshadcn-solidjsComponentsFree2 deps
alert-dialogalert-dialogshadcn-solidjsComponentsFree2 deps
aspect-ratioaspect-ratioshadcn-solidjsComponentsFreeno deps
attachmentattachmentshadcn-solidjsComponentsFree2 deps
avataravatarshadcn-solidjsComponentsFree1 dep
breadcrumbbreadcrumbshadcn-solidjsComponentsFree1 dep
bubblebubbleshadcn-solidjsComponentsFree2 deps

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex