Newton's cradle

The desk toy. Each ball hangs from two strings, and the swing fades out by itself. Click to set it going again.

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

NewtonsCradle3D props

PropTypeDefaultDescription
ballsnumber5Number of balls.
ballnumber46Ball diameter in px.
lengthnumber150String length in px.
amplitudenumber38Peak swing angle in degrees.
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