BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/lyse/badge

badge

lyse/badge
FreeComponent

lyse publishes no description for this item.

Live preview

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

Install it

npx shadcn@latest add https://ui.getlyse.com/r/badge.json

Source

registry/new-york/ui/badge/badge.tsxui.getlyse.com/r/badge.json
1import * as React from "react"
2import { cva, type VariantProps } from "class-variance-authority"
3
4import { cn } from "@/lib/utils"
5import "./badge.css"
6
7const badgeVariants = cva(
8 "inline-flex items-center justify-center overflow-hidden whitespace-nowrap rounded-full [&_svg]:pointer-events-none [&_svg]:shrink-0",
9 {
10 variants: {
11 variant: {
12 brand: "badge-brand",
13 neutral: "badge-neutral",
14 success: "badge-success",
15 danger: "badge-danger",
16 warning: "badge-warning",
17 },
18 size: {
19 sm: "min-w-5 gap-[var(--layout-gap-xs)] px-[var(--layout-padding-sm)] py-[var(--layout-padding-2xs)] text-content-caption [&_svg]:size-3 [&_.badge-dot]:size-1.5",
20 md: "min-w-6 gap-[var(--layout-gap-sm)] px-[var(--layout-padding-md)] py-[var(--layout-padding-xs)] text-content-caption [&_svg]:size-3 [&_.badge-dot]:size-1.5",
21 lg: "min-w-7 gap-[var(--layout-gap-sm)] px-[var(--layout-padding-lg)] py-[var(--layout-padding-xs)] text-content-note [&_svg]:size-3.5 [&_.badge-dot]:size-2",
22 },
23 type: {
24 fill: "",
25 light: "badge-light",
26 dash: "badge-dash",
27 },
28 },
29 defaultVariants: {
30 variant: "neutral",
31 size: "md",
32 type: "fill",
33 },
34 }
35)
36
37function BadgeDot({ className }: { className?: string }) {
38 return <span className={cn("badge-dot shrink-0", className)} />
39}
40
41function Badge({
42 className,
43 variant,
44 size,
45 type,
46 isFilled = false,
47 children,
48 ...props
49}: React.ComponentProps<"span"> &
50 VariantProps<typeof badgeVariants> & {
51 isFilled?: boolean
52 }) {
53 return (
54 <span
55 data-slot="badge"
56 className={cn(
57 badgeVariants({ variant, size, type, className }),
58 isFilled && "badge-filled"
59 )}
60 {...props}
61 >
62 {children}
63 </span>
64 )
65}
66
67export { Badge, BadgeDot, badgeVariants }

What it pulls in

npm packages

  • class-variance-authority

Other registry items

  • https://ui.getlyse.com/r/lyse-tokens.json

Files it writes

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

Facts

Registry
lyse
Type
registry:ui
Access
Free
Files written
2
Licence
MIT
First indexed
2026-08-03
Last confirmed
yesterday

Go to the source

Docs on lyse ui.getlyse.com lyse-labs/lyse-registry on GitHub Raw registry item This item as JSON

More from lyse

All 33 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
action-cardaction-cardlyseComponentsFreeno deps · 2 files
alertalertlyseComponentsFree2 deps · 2 files
alert-dialogalert-dialoglyseComponentsFree2 deps · 2 files
avataravatarlyseComponentsFree3 deps · 2 files
banner-infobanner-infolyseComponentsFree2 deps · 2 files
breadcrumbbreadcrumblyseComponentsFree2 deps · 2 files
buttonbuttonlyseComponentsFree2 deps · 2 files
callout-cardcallout-cardlyseComponentsFree1 dep · 2 files
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