shadimage
starseam
uibadgesource: ok · hit

Badge

A stamped status tag: hairline border, no fill. Colour is severity, never decoration.

npx shadcn add "https://starseam.astroicers.link/r/badge.json"
free

Where it goes

stats

Interaction

animated-counter

Tags auto-generated by rules on 9/24/2026 — empty means no evidence, not lack of support.

Dependencies

Bundle weight · light

Registry dependencies

https://starseam.astroicers.link/r/theme.json

Files1 · source cached 10/8/2026, 6:52:16 PM

registry/starseam/ui/badge.tsx
import * as React from "react";
import { cn } from "@/lib/utils";

type Severity = "nominal" | "live" | "warn" | "crit";

const STATE: Record<Severity, string> = {
  nominal: "border-[var(--ss-seam-strong)] text-[var(--ss-text-2)]",
  live: "border-[var(--ss-live)] text-[var(--ss-live)]",
  warn: "border-[var(--ss-warn)] text-[var(--ss-warn)]",
  crit: "border-[var(--ss-crit)] text-[var(--ss-crit)]",
};

export interface BadgeProps extends React.ComponentProps<"span"> {
  /**
   * Colour is severity, never decoration (DECISIONS 01). Most badges are
   * nominal; a coloured badge is a claim about the state of the thing.
   */
  state?: Severity;
}

/**
 * A stamped status tag: hairline border, no fill, instrument lettering.
 * The severity variants keep an outline treatment rather than a solid wash —
 * the colour marks, it does not paint (DECISIONS 02).
 */
function Badge({ className, state = "nominal", ...props }: BadgeProps) {
  return (
    <span
      data-slot="badge"
      data-state={state}
      className={cn(
        "inline-flex items-center rounded-[var(--ss-radius)] border px-[7px] py-[2px]",
        "font-[family-name:var(--ss-mono)] text-[10.5px] uppercase tracking-[var(--ss-track-label)]",
        STATE[state],
        className
      )}
      {...props}
    />
  );
}

export { Badge };

More from starseam

Browse all components in this library →