Plane

crash.tsx

Best cash out 0.00×

  • Recent rounds show here

Ready

1.00×

Start a round

Install

$ bunx --bun shadcn add @beui/crash

API Reference

autoCashOut?
number | null

Multiplier to cash out at automatically (controlled), or null for manual play. Applies from the next round.

Default—
defaultAutoCashOut?
number | null

Initial auto cash-out when uncontrolled. Default null (off).

Default—
onAutoCashOutChange?
((autoCashOut: number | null) => void)

Called when the Auto menu changes between rounds.

Default—
getCrashPoint?
(() => number | Promise<number>)

Decides each round's crash point, called once when the round starts. Return a number, or a Promise for one (a server round, a provably fair hash): the main button shows Starting… until it settles, and a rejection returns to Start. Values below 1 or not finite become 1, and values are floored to two decimals. Default `crashPoint()`. Ignored when `crashAt` is passed.

Default—
crashAt?
CrashReveal | null

Live rounds (controlled), for a server that keeps the crash point secret until it happens: the round `onStart` was given and its crash point once revealed, or null. A round flies open-ended until its own crash point arrives; a value for any other round is ignored, so a reveal from last round can't end this one. A value at or below the current multiplier crashes at once, at that value, and a cash out above it never happened: the round ends lost and `onCashOut` is not called. A value still ahead means the display is behind the server: the flight runs out to it quickly and takes no more hand cash outs (an auto target below it still pays). Whether a round is live is fixed when it starts; dropping `crashAt` mid-round ends it at the current multiplier.

Default—
onStart?
((round: number) => void)

Called when the player starts a round, before its crash point is known, with the round's number (unique on the page).

Default—
onCashOut?
((multiplier: number) => void)

Called when the player cashes out, by hand or automatically. In a live round it waits until the crash point is revealed, so it only fires for a cash out that stands.

Default—
onCrash?
((crashPoint: number, cashedOut: number | null) => void)

Called when the round crashes, with the cash-out multiplier or null if the player was still in.

Default—
sound?
boolean

Play synthesized sounds (controlled): a climbing chime at each milestone (2× to 5×, then 10×, 20×, 50×…), a cash-out arpeggio and a crash blast.

Default—
defaultSound?
boolean

Initial sound state when uncontrolled. Default false.

Default—
onSoundChange?
((sound: boolean) => void)

Called when the sound button is toggled.

Default—
aria-label?
string

Accessible name for the game. Default "Crash".

DefaultCrash
className?
string
Default—

Balloon

crash-balloon.tsx

Best cash out 0.00×

  • Recent rounds show here

Ready

1.00×

Start a round

Install

$ bunx --bun shadcn add @beui/crash-balloon

API Reference

autoCashOut?
number | null

Multiplier to cash out at automatically (controlled), or null for manual play. Applies from the next round.

Default—
defaultAutoCashOut?
number | null

Initial auto cash-out when uncontrolled. Default null (off).

Default—
onAutoCashOutChange?
((autoCashOut: number | null) => void)

Called when the Auto menu changes between rounds.

Default—
getCrashPoint?
(() => number | Promise<number>)

Decides each round's crash point, called once when the round starts. Return a number, or a Promise for one (a server round, a provably fair hash): the main button shows Starting… until it settles, and a rejection returns to Start. Values below 1 or not finite become 1, and values are floored to two decimals. Default `crashPoint()`. Ignored when `crashAt` is passed.

Default—
crashAt?
CrashReveal | null

Live rounds (controlled), for a server that keeps the crash point secret until it happens: the round `onStart` was given and its crash point once revealed, or null. A round flies open-ended until its own crash point arrives; a value for any other round is ignored, so a reveal from last round can't end this one. A value at or below the current multiplier crashes at once, at that value, and a cash out above it never happened: the round ends lost and `onCashOut` is not called. A value still ahead means the display is behind the server: the flight runs out to it quickly and takes no more hand cash outs (an auto target below it still pays). Whether a round is live is fixed when it starts; dropping `crashAt` mid-round ends it at the current multiplier.

Default—
onStart?
((round: number) => void)

Called when the player starts a round, before its crash point is known, with the round's number (unique on the page).

Default—
onCashOut?
((multiplier: number) => void)

Called when the player cashes out, by hand or automatically. In a live round it waits until the crash point is revealed, so it only fires for a cash out that stands.

Default—
onCrash?
((crashPoint: number, cashedOut: number | null) => void)

Called when the round crashes, with the cash-out multiplier or null if the player was still in.

Default—
sound?
boolean

Play synthesized sounds (controlled): a climbing chime at each milestone (2× to 5×, then 10×, 20×, 50×…), a cash-out arpeggio and a crash blast.

Default—
defaultSound?
boolean

Initial sound state when uncontrolled. Default false.

Default—
onSoundChange?
((sound: boolean) => void)

Called when the sound button is toggled.

Default—
aria-label?
string

Accessible name for the game. Default "Crash".

DefaultCrash
className?
string
Default—

Tower

crash-tower.tsx

Best cash out 0.00×

  • Recent rounds show here

Ready

1.00×

Start a round

Install

$ bunx --bun shadcn add @beui/crash-tower

API Reference

autoCashOut?
number | null

Multiplier to cash out at automatically (controlled), or null for manual play. Applies from the next round.

Default—
defaultAutoCashOut?
number | null

Initial auto cash-out when uncontrolled. Default null (off).

Default—
onAutoCashOutChange?
((autoCashOut: number | null) => void)

Called when the Auto menu changes between rounds.

Default—
getCrashPoint?
(() => number | Promise<number>)

Decides each round's crash point, called once when the round starts. Return a number, or a Promise for one (a server round, a provably fair hash): the main button shows Starting… until it settles, and a rejection returns to Start. Values below 1 or not finite become 1, and values are floored to two decimals. Default `crashPoint()`. Ignored when `crashAt` is passed.

Default—
crashAt?
CrashReveal | null

Live rounds (controlled), for a server that keeps the crash point secret until it happens: the round `onStart` was given and its crash point once revealed, or null. A round flies open-ended until its own crash point arrives; a value for any other round is ignored, so a reveal from last round can't end this one. A value at or below the current multiplier crashes at once, at that value, and a cash out above it never happened: the round ends lost and `onCashOut` is not called. A value still ahead means the display is behind the server: the flight runs out to it quickly and takes no more hand cash outs (an auto target below it still pays). Whether a round is live is fixed when it starts; dropping `crashAt` mid-round ends it at the current multiplier.

Default—
onStart?
((round: number) => void)

Called when the player starts a round, before its crash point is known, with the round's number (unique on the page).

Default—
onCashOut?
((multiplier: number) => void)

Called when the player cashes out, by hand or automatically. In a live round it waits until the crash point is revealed, so it only fires for a cash out that stands.

Default—
onCrash?
((crashPoint: number, cashedOut: number | null) => void)

Called when the round crashes, with the cash-out multiplier or null if the player was still in.

Default—
sound?
boolean

Play synthesized sounds (controlled): a climbing chime at each milestone (2× to 5×, then 10×, 20×, 50×…), a cash-out arpeggio and a crash blast.

Default—
defaultSound?
boolean

Initial sound state when uncontrolled. Default false.

Default—
onSoundChange?
((sound: boolean) => void)

Called when the sound button is toggled.

Default—
aria-label?
string

Accessible name for the game. Default "Crash".

DefaultCrash
className?
string
Default—

Keep in mind

Some components on this site are inspired by or recreated from existing work across the web. I'm not here to take credit; just to learn, experiment, and sometimes push things a bit further. If something looks familiar and I forgot to mention you, reach out and I'll fix that right away.

Updated