Back to Components
Components

Sale Badge

Corner badge showing discount percentage or custom sale text with configurable position.

Sale
25% Off
New
50% Off

Dependencies

  • clsx
  • tailwind-merge
  • class-variance-authority

Files

  • components/ui/sale-badge.tsx

Installation

Using shadcn CLI

npx shadcn add sale-badge --url https://ui.hampton.io

Manual installation

Copy the component file to your project and install dependencies:

npm install clsx tailwind-merge class-variance-authority