Lanyard Badge

Lanyard Badge

A badge dangling from a lanyard with real rope physics — grab it, throw it, and it swings on a verlet-simulated strap until it settles.

Installation

▸ Run the following command

npx shadcn@latest add https://www.mellowui.com/r/lanyard-badge.json

▸ Or install manually

  1. Copy the source from the Code tab above.
  2. Place it at components/mellow/lanyard-badge.tsx
  3. Import and use.

API Reference

PropTypeDefaultDescription
childrenReact.ReactNodeBadge face content — fills the card.
heightnumber430Container height in px.
strapLengthnumber185Strap rest length in px, anchor to clip.
cardWidthnumber240Card width in px.
cardHeightnumber150Card height in px.
gravitynumber2600Downward pull in px/s² — higher swings snappier.
classNamestringAdditional CSS classes.