ID Badge

A propaganda-style identity badge with avatar, name, role, and active star indicator.

IP
ENGINEERIvan Petrov
Maria Volkov
DIRECTORMaria Volkov
Alexei Sorokin
WORKERAlexei Sorokin
YG
Yuri Gagarin

Installation

pnpm dlx shadcn@latest add https://propcore.dev/r/id-badge.json

Usage

import { IdBadge } from "@/components/ui/id-badge"
<IdBadge
  name="Ivan Petrov"
  role="ENGINEER"
  active
/>

Props

PropTypeDefaultDescription
namestringrequiredPerson's name
rolestring"COMRADE"Role/title displayed above name
srcstring-Avatar image URL
altstring-Avatar alt text
fallbackstring-Initials to show if no image
activebooleanfalseShows diagonal red stripe with star
variant"default" | "compact""default"Size variant
classNamestring-Additional CSS classes

Examples

With Image

<IdBadge
  name="Maria Volkov"
  role="DIRECTOR"
  src="/avatar.jpg"
/>

Active Status

<IdBadge
  name="Alexei Sorokin"
  role="WORKER"
  active
/>

Compact Variant

<IdBadge
  name="Yuri Gagarin"
  variant="compact"
/>

Features

  • Red left edge accent for visual emphasis
  • Diagonal active indicator with star
  • Automatic initials from name when no image
  • Compact variant for tight spaces