Skip to content

Badge

Small tinted label (neutral, accent, success, warning, danger, outline) with optional status dot, live pulse, pill shape and mono mode for IDs and service names.

minimal/ui/badge
Open ↗

Source

import type { HTMLAttributes } from "react";
import { cn } from "@/lib/utils";

export type BadgeVariant = "neutral" | "accent" | "success" | "warning" | "danger" | "outline";

const VARIANTS: Record<BadgeVariant, { badge: string; dot: string }> = {
  neutral: { badge: "bg-da-muted text-da-muted-fg", dot: "bg-da-muted-fg" },
  accent: { badge: "bg-da-accent text-da-accent-fg", dot: "bg-da-primary" },
  success: { badge: "bg-da-success/12 text-da-fg", dot: "bg-da-success" },
  warning: { badge: "bg-da-warning/15 text-da-fg", dot: "bg-da-warning" },
  danger: { badge: "bg-da-danger/12 text-da-fg", dot: "bg-da-danger" },
  outline: { badge: "da-stroke bg-transparent text-da-muted-fg", dot: "bg-da-muted-fg" },
};

export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
  variant?: BadgeVariant;
  /** Colored status dot before the label. */
  dot?: boolean;
  /** Pulse the dot (live states). Disabled with reduced motion. */
  pulse?: boolean;
  shape?: "rounded" | "pill";
  /** Monospace label, for IDs and codes. */
  mono?: boolean;
}

export function Badge({ variant = "neutral", dot = false, pulse = false, shape = "rounded", mono = false, className, children, ...props }: BadgeProps) {
  const v = VARIANTS[variant];
  return (
    <span
      className={cn(
        "inline-flex h-5 items-center gap-1.5 px-1.5 text-xs font-medium whitespace-nowrap",
        shape === "pill" ? "rounded-da-pill px-2" : "rounded-[5px]",
        mono && "font-da-mono text-[11px]",
        v.badge,
        className,
      )}
      {...props}
    >
      {dot && (
        <span aria-hidden className="relative flex size-1.5">
          {pulse && <span className={cn("absolute inset-0 animate-ping rounded-full opacity-70 motion-reduce:hidden", v.dot)} />}
          <span className={cn("relative size-1.5 rounded-full", v.dot)} />
        </span>
      )}
      {children}
    </span>
  );
}

export default Badge;

modules/minimal/ui/badge/index.tsx

Props

PropTypeDefaultDescription
variant"neutral" | "accent" | "success" | "warning" | "danger" | "outline""neutral"Tint.
dotbooleanfalseStatus dot.
pulsebooleanfalseAnimated ping around the dot.
shape"rounded" | "pill""rounded"Corner style.
monobooleanfalseMonospace text.
...restHTMLAttributes<HTMLSpanElement>—Native span attributes.

Other badge variants in Minimal

Badge in other art directions

Badge

Mono uppercase label with ink stroke in 8 solid variants (status + brand colors), two sizes, optional square status dot and a tilted sticker mode.

BrutalistBadge

Counter Badge

Notification counter that wraps any element (icon button, avatar) and pins a ruled square count to its corner; caps at max+, dot mode, three tones, hidden at zero.

BrutalistBadge

Sticker Badge

Round SVG sticker badge: dashed scalloped edge, text running around a circular path, big center label, hard offset drop shadow and a slight tilt. Four solid tones, any size.

BrutalistBadge

Tag List

Editable tag field: color-cycling ruled chips with remove buttons inside a boxed input, Enter/comma to add, Backspace to remove last, quick-add suggestion chips and a max limit.

BrutalistBadge

Avatar Stack

Overlapping gradient initials avatars inside a glass pill with a dark “+N” overflow bubble and a count label; avatars lift on hover.

GlassBadge

Badge

Pill badge in frosted glass, gradient or tinted status variants (primary, success, warning, danger) with optional dot, glowing live dot and leading icon. Two sizes.

GlassBadge

Presence Avatar

Gradient initials avatar with a presence dot (online, busy, away, offline); the “speaking” state adds a spinning conic gradient ring. Three sizes.

GlassBadge

Reaction Chip

Slack-style emoji reaction chips in glass: click to add/remove your reaction, the count pops, and reacted chips get a primary ring and tint.

GlassBadge

Badge

Square mono tag in four variants: hairline outline, ink solid, subtle gray and signal orange (for “New” only).

Mono CleanBadge

Index Counter

Editorial index counter “03 / 12” in mono with zero padding and an optional hairline progress bar — for galleries, slides and case-study chapters.

Mono CleanBadge

Kbd

Keyboard shortcut hint: square hairline key caps in mono, joined, with an optional muted action label — e.g. “⌘ K Search”.

Mono CleanBadge

Status Dot

Minimal status indicator: a 6px dot (filled, hollow or pulsing signal for “building”) followed by a mono uppercase label.

Mono CleanBadge

Badge

Compact 4px-radius label in six tones × three variants (soft, outline, solid), two sizes, optional leading icon.

Neo CorporateBadge

Delta Badge

KPI delta chip: arrow + signed percentage, green when the change is favourable and red otherwise (`invert` for metrics where down is good), optional “vs last month”.

Neo CorporateBadge

Filter Chips

Active-filter bar: “field: value” chips with a remove (×) button each, a result-count region and “Clear all”; announces removals.

Neo CorporateBadge

Status Badge

Invoice/payment lifecycle status pill with a colored dot: draft, sent, viewed, paid, partial, overdue, void.

Neo CorporateBadge

Badge

Soft rounded pill label in natural tints (sage, clay, sand, forest, sun, berry), two sizes, optional leading icon.

Organic SoftBadge

Impact Badge

Impact/effort rating shown as three leaves (filled up to the level) with a text label — used on reduction actions.

Organic SoftBadge

Scope Badge

GHG scope indicator: a leaf-shaped chip with the scope number (forest / sage / clay) and an optional label; title explains the scope.

Organic SoftBadge

Status Pill

Target/action progress pill with a soft pulsing dot for active states (on track, at risk, off track) and static ones (done, not started).

Organic SoftBadge

Badge

Rounded pastel pill badge in seven tones (peach, mint, lavender, butter, neutral, primary, danger) and two sizes, with optional emoji/icon or dot.

Soft FlatBadge

Label Tags

Editable label set: pastel tags (rotating colors) with round × buttons and a dashed “+ Add label” pill that becomes an inline input (Enter adds, Escape cancels).

Soft FlatBadge

Status Dot

Task status indicator: colored dot in a soft halo plus label (To do, In progress (pulsing), In review, Done, Blocked); compact dot-only mode keeps a hidden label.

Soft FlatBadge

Streak Badge

Gamified streak badge: flame + “12-day streak” on a butter pill and seven round weekday dots, peach with a check on active days.

Soft FlatBadge