---
title: "Event Badge"
description: "A conference badge on a strap in 3D: drag it, throw it, and it swings back. A QR ticket is on the back. Enter or Space turns it."
url: https://gelatinui.com/components/event-badge
markdown_url: https://gelatinui.com/components/event-badge.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/event-badge"
version: "2026-11-09"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Event Badge

> A conference badge on a strap in 3D: drag it, throw it, and it swings back. A QR ticket is on the back. Enter or Space turns it.

Page: https://gelatinui.com/components/event-badge

## When to use it

Best for: A ticket or a speaker pass on an event page that people can drag, throw, and turn.

- Give the attendee data as parts: `EventBadgeName`, `EventBadgeJobTitle`, `EventBadgeCompany`, `EventBadgeTier`, `EventBadgeNumber`, and a ticket link in `EventBadgeTicket`.
- Set `accent` to the brand color, and put the event logo in `EventBadgeLogo`.
- Give the stage a size with `className`. It is 448 × 480 by default.
- Use `back` and `onBackChange` to turn it from a button of your own.

## When not to use it

- For a small label with a status or a count, use a [Badge](https://gelatinui.com/components/badge.md).
- For a flat person card with no effect, use a [Card](https://gelatinui.com/components/card.md).

## Notes for agents

- The faces are drawn on canvases from the parts. The parts render nothing; leave a part out to leave its text out.
- Without `EventBadgeAvatar` the card has no photo circle. With it and no `src`, the circle shows the initials.
- With WebGL2, three.js loads and the 3D badge fades in. With no WebGL2, the flat badge stays and Enter or Space still turns it.
- Images from another origin need CORS headers, or they are left out.
- Each badge makes one WebGL context. Show a few at a time.
- Set `sway={false}` to let the badge rest and draw no frames.

## Anatomy

```text
EventBadge
```

## API reference

### EventBadge

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` |  | The parts of the faces: `EventBadgeName`, `EventBadgeEventName`, and the others. |
| `accent` | `string` | CHERRY | The band, strap, and back color: any CSS color, `var(--primary)` too. |
| `back` | `boolean` |  | The back shows (controlled). |
| `defaultBack` | `boolean` | false | The back shows at the start (uncontrolled). |
| `onBackChange` | `function` |  | Called when Enter or Space turns the card. |
| `onSceneError` | `function` |  | Called when the 3D scene fails to load; the flat badge stays. |
| `foil` | `boolean` | true | A holographic foil on the front that shifts color as the card turns (3D only). |
| `sway` | `boolean` | true | A very slow idle sway, so the badge never looks frozen. With it, the 3D frame loop runs while the badge is on screen; turn it off to let the badge rest and run no frames. |
| `driverRef` | `Ref<DragDriver \| null>` |  | Drives a drag from code (`DragDriver`, no item): a staged scene or a test takes the 3D card, swings it, and lets go, and the rope physics work as for a hand. Only the 3D badge moves. |

### EventBadgeName

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `string` |  |  |

### EventBadgeJobTitle

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `string` |  |  |

### EventBadgeCompany

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `string` |  |  |

### EventBadgeAvatar

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `src` | `string` |  | The photo URL. With none, or when it fails, the initials of the name show. |

### EventBadgeEventName

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `string` |  |  |

### EventBadgeYear

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `string` |  |  |

### EventBadgeDate

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `string` |  |  |

### EventBadgePlace

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `string` |  |  |

### EventBadgeTier

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `string` |  |  |

### EventBadgeNumber

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `string` |  |  |

### EventBadgeTicket

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | `string` |  | The text of the QR code (a ticket link). |

### EventBadgeStrap

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `string` |  |  |

### EventBadgeLogo

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `src` | `string` |  | The logo URL. Another origin needs CORS headers, or WebGL cannot read it. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| EventBadge | `event-badge` | `data-state` |  | `motion-timing` |

## Usage

Give the attendee data as parts. The faces are drawn from them.

```tsx title="speaker-badge.tsx"
import {
  EventBadge,
  EventBadgeAvatar,
  EventBadgeCompany,
  EventBadgeDate,
  EventBadgeEventName,
  EventBadgeJobTitle,
  EventBadgeName,
  EventBadgeNumber,
  EventBadgePlace,
  EventBadgeTicket,
  EventBadgeTier,
  EventBadgeYear,
} from "@/components/pro/cards/event-badge";

export function SpeakerBadge() {
  return (
    <EventBadge>
      <EventBadgeAvatar />
      <EventBadgeName>Ada Lovelace</EventBadgeName>
      <EventBadgeJobTitle>Design Engineer</EventBadgeJobTitle>
      <EventBadgeCompany>Analytical Engines</EventBadgeCompany>
      <EventBadgeEventName>Gelatin Conf</EventBadgeEventName>
      <EventBadgeYear>2026</EventBadgeYear>
      <EventBadgeDate>Nov 12–13</EventBadgeDate>
      <EventBadgePlace>Belgrade</EventBadgePlace>
      <EventBadgeTier>Speaker</EventBadgeTier>
      <EventBadgeNumber>0042</EventBadgeNumber>
      <EventBadgeTicket value="https://example.com/tickets/0042" />
    </EventBadge>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui-pro/event-badge
```

It adds 43 registry items: 42 files, 7883 lines, and the npm packages `@base-ui/react`, `@mantine/hooks`, `@xstate/react`, `clsx`, `etiket`, `motion`, `tailwind-merge`, `three`, `xstate`.

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Tilt](https://gelatinui.com/components/tilt.md)
- [Scratch Card](https://gelatinui.com/components/scratch-card.md)
- [Card](https://gelatinui.com/components/card.md)
- [Avatar](https://gelatinui.com/components/avatar.md)

## Keyboard

| Keys | Action |
| --- | --- |
| Enter | Turns the badge to the back or the front. |
| Space | Turns the badge to the back or the front. |
| Arrow keys | Push the badge, so it swings (3D only). |

## Accessibility

The stage is one tab stop with `role="application"`, `aria-roledescription="event badge"`, and the `EventBadgeName` text as its name. `aria-keyshortcuts` lists the keys.

Enter and Space turn the badge. The arrow keys push it only in 3D; on the flat badge they scroll the page.

In 3D the stage takes every touch (`touch-action: none`), so a finger can drag the badge. Keep it a part of the page, not the full screen.

## Motion

| Part | Motion |
| --- | --- |
| Flat turn | panel · 260ms · ease-panel (0.2, 0.4, 0.2, 1) |
| Flat sway | sine · ±1.2° on a 9s cycle, while the badge is on screen |
| 3D fade in | fade · 150ms · the 3D badge fades in over the flat one |
