Sections
All-AccessNewWebGLA New Year's Eve hero: a faceted midnight ball on a ruled mast that only time lowers, landing on the base as the year lights. The hand spins it; the programme is the scale.
Use it for the page of a New Year's Eve event (a dinner, a concert, a launch at midnight) where the countdown and the evening's programme are the content.
pnpm dlx shadcn@latest add @motionkit-pro/ball-dropnpx shadcn@latest add @motionkit-pro/ball-dropyarn dlx shadcn@latest add @motionkit-pro/ball-dropbunx --bun shadcn@latest add @motionkit-pro/ball-dropRequires an All-Access or Signature license and the @motionkit-pro registry with your token. See Installation.
The files land in components/sections/.
import { BallDrop } from "@/components/sections/ball-drop"
export default function Page() {
return <BallDrop variant="mast" />
}The ball's height on the mast is the time left. Pass target as an absolute instant (a Date, epoch
milliseconds or an ISO string with an offset) and, when you render on the server, now: the
server's clock for that request, so the first frame on the server and in the browser agree. The
time logic is the Countdown's: nothing reads the clock during render,
and a device clock more than a few seconds off is corrected against now.
// Midnight in Trieste, read on the server for each request
<BallDrop target="2027-01-01T00:00:00+01:00" now={Date.now()} window={60} />Without target, it counts to the next 1 January where the visitor is. The ball waits beside the
second last programme line until window seconds (default 60) before the target, comes down the
ruled travel, and lands on the last line at the target, as the year on the base lights. The hand
only spins it. "Rehearse the drop" runs a compressed drop over ten seconds once, then winches the
ball back up; it is offered only before the real drop starts. onComplete fires once at the real
target (never on a rehearsal), for example to fire confetti.
mast (default): preview it with ?demo=default.numeral: preview it with ?demo=numeral.skyline: preview it with ?demo=skyline.Every text, button names included, lives in one typed content prop; keys you leave out keep the demo copy shown above.
<BallDrop content={{ headline: { lead: "See the year in", emphasis: "with us" } }} />Prop
Type
Every colour is a prop and takes any CSS colour: hex, RGB, HSL or OKLCH.
<BallDrop
colors={{
skyTop: "#371113",
skyBottom: "#202900",
ice: "#ffdee2",
gold: "#6bd8ff",
mast: "#170d08",
ink: "#e6f4fe",
}}
/>use-prefers-reduced-motion, ball, fx-runtime, motion-presets, motion-kit, section-runtime.stack: columns stack, text first. Vertical scroll is never blocked.
The drawn ball without spin: at the top of the mast before the window, one step down the scale each second in the last minute, resting on the base after midnight.
pnpm size).Main spring of each temperament. Set it with the temperament prop or MotionKitProvider; the default is lively.
Not measured yet · budget 16.0 kB gzip
Component and MotionKit helpers; excludes react, react-dom.
—
The drawn ball without spin: at the top of the mast before the window, one step down the scale each second in the last minute, resting on the base after midnight.
No keyboard interaction of its own.
Last 2 versions of Chrome, Edge, Firefox and Safari (iOS 16.4+)