alwkala

Badge

Component

About

A small inline label for showing status, counts, or categories, with color tones, pill/outline/subtle styles, sizes, and an optional link mode.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Badge to your project and fits it to your theme.

Code

How Badge is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { Badge } from "@/components/ui/qahera-badge";

export default function BadgeDemo() {
  return (
    <div className="flex flex-col gap-8 p-6">
      <section>
        <h3 className="mb-4 font-bold">Basic badge styling</h3>
        <div className="flex flex-wrap items-center gap-3">
          <Badge variant="primary">Primary</Badge>
          <Badge tone="secondary">Secondary</Badge>
          <Badge tone="info">Info</Badge>
          <Badge tone="success">Success</Badge>
          <Badge tone="danger">Danger</Badge>
          <Badge tone="warning">Warning</Badge>
          <Badge tone="light">Light</Badge>
          <Badge tone="dark">Dark</Badge>
        </div>
      </section>

      <section>
        <h3 className="mb-4 font-bold">Outline &amp; interactive</h3>
        <div className="flex flex-wrap items-center gap-3">
          <Badge variant="outline" tone="primary">
            Primary outline
          </Badge>
          <Badge variant="outline" tone="secondary">
            Secondary outline
          </Badge>
          <Badge variant="outline" tone="success">
            Success outline
          </Badge>
          <Badge variant="outline" tone="danger">
            Danger outline
          </Badge>
          <Badge tone="secondary" href="#link">
            Interactive badge &rarr;
          </Badge>
          <Badge variant="outline" tone="danger" href="#remove">
            Remove &times;
          </Badge>
        </div>
      </section>

      <section>
        <h3 className="mb-4 font-bold">Pill</h3>
        <div className="flex flex-wrap items-center gap-2">
          <Badge shape="pill" tone="light">
            Text
          </Badge>
          <Badge shape="pill" tone="primary">
            7
          </Badge>
          <Badge shape="pill" tone="success">
            +7
          </Badge>
          <Badge shape="pill" tone="info">
            -7
          </Badge>
          <Badge shape="pill" tone="warning">
            10
          </Badge>
        </div>
      </section>

      <section>
        <h3 className="mb-4 font-bold">Sizing</h3>
        <div className="flex flex-wrap items-center gap-2">
          <Badge tone="primary" size="xl">
            Extra large
          </Badge>
          <Badge tone="info" size="lg">
            Large
          </Badge>
          <Badge tone="warning" size="md">
            Medium
          </Badge>
          <Badge tone="danger" size="sm">
            Small
          </Badge>
          <Badge tone="primary" size="xs">
            Extra small
          </Badge>
        </div>
      </section>
    </div>
  );
}

More by alwkala

View all
  • Callout

    Callout

    10
  • Progress Bar

    Progress Bar

    2
  • Breadcrumb

    Breadcrumb

    1
  • Navbar

    Navbar

    1
  • Kbd

    Kbd

  • Pagination

    Pagination

  • Back To Top

    Back To Top

  • Checkbox

    Checkbox