Badge

A small badge component with customizable variants and shiny animation effects.

Badge

Installation

npx shadcn@latest add https://scrollx-ui.vercel.app/registry/badge.json 

Add Utilities

tailwind.config.ts

module.exports = { 
   theme: { 
     extend: { 
       keyframes: { 
         shine: { 
           '0%': { 'background-position': '100%' }, 
          '100%': { 'background-position': '-100%' }, 
         }, 
      }, 
       animation: { 
        shine: 'shine 5s linear infinite', 
       }, 
     }, 
    }, 
    plugins: [], 
 };

Usage

import { Badge } from "@/components/ui/badge";
<Badge variant="default" shiny={true}>Badge</Badge>

Examples


Default

Badge

Secondary

Secondary

Destructive

Destructive

Outline

Outline

API Reference

Badge

The Badge component creates a customizable label with variant styling and optional shiny animation effect.

Props

PropertyTypeDefaultDescription
variant"default" | "secondary" | "destructive" | "outline""default"
Controls the visual style of the badge.
shinybooleanfalse
Enables an animated shine effect.
shinySpeednumber
Controls shine animation speed in seconds.
classNamestring
Custom class names to style the badge.
...propsHTMLDivElement attributes
Supports all standard div props and events.

Built withby Ahdeetai.