Love This UI? Help It Grow and Reach More Developers Worldwide

Badges

A comprehensive collection of 30+ customizable and interactive badge components with stunning glassy effects, animations, and modern styling.

Original Badge Variants

Badge
Soft (Default)
Solid
Outline
Dismissible
Link

Glassy Effect Badges

Glass Basic
Glass Blue
Glass Purple
Glass Green
Glass Pink

Neon Glow Badges

Neon Blue
Neon Purple
Neon Pink
Neon Green
Neon Orange
Neon Red

Gradient Badges

Ocean Blue
Purple Haze
Forest Green
Sunset Orange
Rainbow
Sunset

Frosted Glass Badges

Frosted Basic
Frosted Blue
Frosted Purple
Frosted Green
Frosted Pink

Holographic Badges

Holographic
Cyber Holo
Magic Holo
Dream Holo

Crystal Badges

Crystal Clear
Ice Crystal
Amethyst
Emerald
Rose Quartz

Icon Badges with Glass Effects

Premium
Favorite
Verified
Trending
Fast
VIP

Metallic & Luxury Badges

Silver
Gold Premium
Rose Gold
Platinum

Size Variations with Glass Effects

Extra Small
Small
Medium
Large
Extra Large

Interactive Glass Badges

Clickable Glass
Clickable Frosted
Clickable Crystal

Installation

You can add this component to your project using the CLI or by manually copying the code.

npx shadcn@latest add badge.json

Usage

after installing the component, import it into your page or component file. The Badge component is the main component that you will use. It has many props that you can use to customize it.

Loading...

Props

The Badge component accepts the following props for comprehensive customization:

PropTypeDefaultRequiredDescription
childrenReactNode-NoThe content to display inside the badge
size'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl''md'NoControls the size of the badge
shape'rounded' | 'pill' | 'square' | 'circle''rounded'NoDefines the shape of the badge
animation'none' | 'pulse' | 'bounce' | 'float' | 'glow' | 'shake' | 'rotate' | 'scale' | 'gradient-shift''none'NoApplies animation effects to the badge
position'static' | 'absolute' | 'fixed' | 'sticky''static'NoCSS position property for the badge
iconLeftReactElement-NoIcon to display on the left side of the badge content
iconRightReactElement-NoIcon to display on the right side of the badge content
badgestring | number-NoNotification badge to display (e.g., count)
loadingbooleanfalseNoShows a loading spinner when true
classNamestring-NoAdditional CSS classes for custom styling
styleReact.CSSProperties{}NoInline styles for the badge
blur'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl''none'NoBackdrop blur effect intensity
opacitynumber-NoOpacity value for the badge (0-1)
shadow'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'inner''none'NoShadow effect for the badge
glowbooleanfalseNoAdds a glowing effect to the badge
animationDuration'fast' | 'normal' | 'slow''normal'NoDuration of animations and transitions
disabledbooleanfalseNoDisables the badge and applies disabled styling
activebooleanfalseNoApplies active state styling
onDismiss(event: MouseEvent<HTMLButtonElement>) => void-NoCallback when dismiss button is clicked
onHover(event: MouseEvent<HTMLElement>) => void-NoCallback when badge is hovered
onFocus(event: React.FocusEvent<HTMLElement>) => void-NoCallback when badge receives focus
onClick(event: MouseEvent<HTMLButtonElement>) => void-NoMakes badge clickable as a button
hrefstring-NoMakes badge a link to the specified URL
topstring | number-NoTop position for absolute/fixed positioned badges
rightstring | number-NoRight position for absolute/fixed positioned badges
bottomstring | number-NoBottom position for absolute/fixed positioned badges
leftstring | number-NoLeft position for absolute/fixed positioned badges
zIndexnumber-NoZ-index for layering positioned badges
aria-labelstring-NoAccessibility label for screen readers
aria-describedbystring-NoID of element that describes the badge
rolestring-NoARIA role for accessibility

Examples

Here are some examples of how to use different props:

Loading...