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/fiberCopy 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
| Prop | Type | Default | Description |
|---|---|---|---|
maxSpeed | number | 50 | Maximum speed for physics simulation |
minSpeed | number | 10 | Minimum speed for physics simulation |
className | string | "" | Additional CSS classes for the container |
width | string | number | "100%" | Width of the container |
height | string | number | "100vh" | Height of the container |
cardModel | string | "/card.glb" | URL of the card .glb model |
bandTexture | string | "/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"
/>
)
}