IdBadge

A badge on a lanyard. It swings as your pointer crosses it and keeps swinging like a pendulum. Press it and it turns over to the code side. Cards.

Open playground

About

IdBadge is a React component in the Cards category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { IdBadge } from "@ashutoshswamy/smoui" and set name, id, org among its 5 props.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { IdBadge } from "@ashutoshswamy/smoui";

<IdBadge name="Mara Okafor" role="Product designer" id="SM-20417" />

Props 5

name / role

Who it belongs to.

string
id

Shown at the bottom and encoded into the barcode.

string
org

Label in the corner of the photo. Default smoui.

string
avatar

Photo URL. Without one a mesh portrait is made from the name.

string
fields

Two or three small facts under the name.

{ label; value }[]