Hanging Id Card

Ceiling-anchored lanyard badge with realistic pendulum physics - drag to swing, release with inertia, or tap for a nudge. Pass children to replace the default badge face.

Default

Drag sideways to swing, or click when settled for a soft impulse. Respects prefers-reduced-motion.

Loading…

Installation

CLI
npx @sonojs/ui@latest add hanging-id-card

Usage

page.tsx
"use client"

import { HangingIdCard } from "@/components/3d/hanging-id-card"

export default function Page() {
  return (
    <div className="flex justify-center px-4 py-10">
      <HangingIdCard showHint />
    </div>
  )
}

Props

PropTypeDefaultDescription
namestring"Alex Rivera"Badge display name (default face).
rolestring"Product Designer"Title under the name.
badgeIdstring"ID-84920"Monospace ID under the barcode.
accentColorstring"#2563EB"Header gradient start, ID text, and status chip.
companystring"SonoJS"Small uppercase label above the avatar.
ropeLengthnumber120Lanyard strap length (auto-shrinks on narrow screens).
ropeColorstring"#18181b"Strap fill color.
showHintbooleanfalseShow “Drag to swing · click to nudge” under the badge.
classNamestring-Classes on the outer stage.
childrenReactNode-Custom card face (replaces the default badge body).