Token Fall

Customize
Count34
Min size12
Max size25
Gravity0.35
Bounciness0.75
Spawn interval180

Installation

pnpm dlx shadcn@latest add @clover-ui/token-fall

Usage

import { TokenFall } from "@/components/token-fall";

<div className="relative h-72 w-full overflow-hidden rounded-2xl">
  <TokenFall count={34} minSize={12} maxSize={25} />
</div>

It fills its parent, so give the parent a position and a height. Move your cursor near the tokens to push them away.

Props

PropType
Default55
Default14
Default28

Color pairs picked at random for each token.

Draw your own token instead of the coin.

Default0.35

Bounciness, from 0 to 1.

Default0.75
Default150
Default0.0015

Milliseconds between new tokens.

Default180