Skip to content
VenusUI
Get started

Matchbox

A matchbox with a sliding tray and matches you can strike one at a time.

Preview

Installation

npx shadcn@latest add @venusui/matchbox

Run this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.

Files added to your project

Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.

  • @/components/ui/matchbox.tsx

Usage

The code behind the preview above.

matchbox-demo.tsx

import { Matchbox } from "@/components/ui/matchbox"

export default function MatchboxDemo() {
  return <Matchbox />
}

API reference

PropTypeDefaultDescription
titlestring"Good Light"Big line on the label.
subtitlestring"Safety matches"Small line on the label.
countnumber12Matches in the box.
burnTimenumber6000Burn time in milliseconds.
onStrike(remaining: number) => void—Called when a match is lit.

All <div> props.

Requirements

  • lucide-react for icons. React 19 and Tailwind CSS v4. The CLI adds the keyframes.

Customization

  • Use onStrike for a small reward, such as revealing a hint.

Accessibility

  • Open and strike are ordinary buttons, and lighting a match is announced.

Troubleshooting

Something looks different from the preview.
Components use your project’s theme tokens, so surrounding colours and radius follow your styles.
Unknown registry "@venusui"
Your shadcn CLI couldn’t find the namespace in the shadcn registry index. Use the latest CLI (npx shadcn@latest), install by URL, or register it with its address: npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json.
No components.json found
Run npx shadcn@latest init in your project first.
Loading preview

A card that tilts in 3D toward the pointer with spring physics.

Loading preview

Camera Shutter

Interactive

A lens with a working iris: blades close to the chosen aperture and snap shut when you release the shutter.

Loading preview

Stacked cards with the next ones peeking out; Next sends the top card to the back.