Docs
3D event badge

3D event badge

Displays a beautiful 3D event badge with React Three Fiber.

Inspired by Vercel React Three Fiber, this 3D Badge component leverages the power of React Three Fiber to create an interactive and visually stunning badge. Perfect for events, profiles, or any application that can benefit from a unique 3D element.

Installation

Install the following dependencies:

npm install three meshline @react-three/rapier @react-three/drei @react-three/fiber

Copy and paste the code into your project.

Add the 3D card model and band texture.

Download the 3D card model and save it as public/card.glb. Add an image for the lanyard band as public/kroul.png, or pass your own files with the cardModel and bandTexture props.

API Reference

Props

PropTypeDefaultDescription
maxSpeednumber50Maximum speed for physics simulation
minSpeednumber10Minimum speed for physics simulation
classNamestring""Additional CSS classes for the container
widthstring | number"100%"Width of the container
heightstring | number"100vh"Height of the container
cardModelstring"/card.glb"URL of the card .glb model
bandTexturestring"/kroul.png"URL of the lanyard band texture

Usage

export default function Demo() {
  return (
    <LanyardCard
      className="rounded-lg shadow-xl"
      height="80vh"
      backgroundColor="bg-gray-900"
    />
  )
}