Magic 8 Ball

Think of a question, then shake the ball. It rattles around and an answer floats up in the window.

Install it the shadcn way: copy the source file into your project. It uses CSS 3D, Tailwind CSS v4 and Framer Motion, no WebGL.

EightBall3D props

PropTypeDefaultDescription
answersstring[]DEFAULTPossible answers. One is picked at random after each shake.
sizenumber220Ball diameter in px.
onAnswer(answer: string) => voidCalled with the chosen answer after each shake.
classNamestringExtra classes added to the outer element.

More components

Guides

Start

Cards

Scenes

Controls & text

Buttons

More cards

UI elements

Form controls

App components

Text & backgrounds

Showpieces

Blocks