Miss. Train. Move.

Dribble

Loaders, AI thinking. A ball kept bouncing on the beat.

Warming up
Sport
Basketball
Move
A ball kept bouncing on the beat.
For
Loaders, AI thinking

one beat 500ms · hidden for 400ms · reduced: still ball

01 Install

Terminal
npx shadcn@latest add https://moveui-red.vercel.app/r/dribble.json

It brings the tokens with it. The first time, import the tokens once in your root layout:

app/layout.tsx
import "@/components/moveui/tokens.css";

Not using shadcn? Copy the files below into components/moveui/, and tokens.css next to them.

02 Use it

Example
import { Dribble } from "@/components/moveui/dribble/dribble";

{loading && <Dribble label="Warming up" variant="dribble" />}

03 Or ask your agent

Paste this into Claude Code, Cursor or any coding agent. It installs the piece and wires it in.

Prompt
Add the Move UI "Dribble" piece to this project. It's for: Loaders, AI thinking.

1. Install it: npx shadcn@latest add https://moveui-red.vercel.app/r/dribble.json
2. If the project doesn't import the Move UI tokens yet, add this once to the root layout: import "@/components/moveui/tokens.css";
3. Use it like this, adapted to where it belongs in my code:

import { Dribble } from "@/components/moveui/dribble/dribble";

{loading && <Dribble label="Warming up" variant="dribble" />}

Keep its reduced-motion behaviour and keyboard support. Don't hardcode durations, easing or colours: they come from the --ml-* tokens.
Docs: https://moveui-red.vercel.app/pieces/dribble

Want your agent to know the whole library and its motion rules? Add the Move UI skill to your project:

Terminal
npx shadcn@latest add https://moveui-red.vercel.app/r/skill.json

04 Code

components/moveui/dribble/dribble.tsx
"use client";

import { useEffect, useState } from "react";
import "./dribble.css";

/**
 * Dribble: a loading state for agents and long tasks. A small ball keeps a rhythm, the label gets a
 * floodlight sweep, and the elapsed time counts up. It stays hidden for --ml-wait (400ms), so quick
 * work never flashes a loader. Three styles: "dribble" (a ball bouncing on the floor), "pass"
 * (a ball passed along a line of three) and "rondo" (passed around a circle).
 * It is a polite status region: screen readers hear the label, not every tick of the timer.
 * Reduced motion: the ball holds still and the sweep stops; the timer still counts.
 */
type Props = {
  label: string;
  variant?: "dribble" | "pass" | "rondo";
  /** When the work started (performance.now()). Defaults to mount time. */
  since?: number;
  showTime?: boolean;
  className?: string;
};

export function Dribble({ label, variant = "dribble", since, showTime = true, className }: Props) {
  const [start] = useState(() => since ?? performance.now());
  const [elapsed, setElapsed] = useState(0);

  useEffect(() => {
    if (!showTime) return;
    const t = setInterval(() => setElapsed((performance.now() - start) / 1000), 100);
    return () => clearInterval(t);
  }, [start, showTime]);

  return (
    <span className={["ml-dribble", className].filter(Boolean).join(" ")} data-variant={variant} role="status">
      <span className="ml-dribble__ball" aria-hidden="true">
        {variant === "rondo" ? [0, 1, 2, 3, 4, 5].map((i) => <i key={i} style={{ ["--i" as string]: i }} />) : variant === "pass" ? <><i /><i /><i /><b /></> : <b />}
      </span>
      <span key={label} className="ml-dribble__label">{label}</span>
      {showTime && <span className="ml-dribble__time" aria-hidden="true">{elapsed.toFixed(1)}s</span>}
    </span>
  );
}
components/moveui/dribble/dribble.css
/*
  Dribble. Everything runs on --ml-beat (500ms, 120bpm).
  Dribble: the ball falls with gravity (ease-in), squashes on the floor, rises easing out.
  Pass: the ball travels in a small arc between three marks and back.
  Rondo: six marks, the ball goes round, one per sixth of two beats.
  Label: a floodlight sweeps across it every three beats. New labels rise in with a settle.
  The whole thing fades in after --ml-wait. Reduced motion: still ball, no sweep.
*/
.ml-dribble {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9375rem;
  line-height: 1;
  animation: ml-dribble-show var(--ml-dur-quick) var(--ml-ease-out) var(--ml-wait) both;
}
@keyframes ml-dribble-show { from { opacity: 0; } }

.ml-dribble__ball { position: relative; display: inline-block; width: 18px; height: 18px; flex: none; }
.ml-dribble__ball b,
.ml-dribble__ball i { position: absolute; display: block; border-radius: 50%; background: var(--ml-ink); }

/* Dribble: one ball and its floor */
[data-variant="dribble"] .ml-dribble__ball { border-bottom: 1.5px solid var(--ml-line); }
[data-variant="dribble"] .ml-dribble__ball b {
  width: 7px; height: 7px; left: 5.5px; bottom: 0;
  transform-origin: 50% 100%;
  animation: ml-dribble-bounce var(--ml-beat) infinite;
}
@keyframes ml-dribble-bounce {
  0% { transform: translateY(-10px); animation-timing-function: cubic-bezier(0.5, 0, 0.9, 0.5); }
  46% { transform: translateY(0) scale(1.35, 0.65); animation-timing-function: var(--ml-ease-out); }
  56% { transform: translateY(-1px) scale(0.95, 1.08); animation-timing-function: var(--ml-ease-out); }
  100% { transform: translateY(-10px); }
}

/* Pass: three marks, the ball moves between them in an arc */
[data-variant="pass"] .ml-dribble__ball i { width: 3px; height: 3px; bottom: 3px; background: var(--ml-fg-muted); opacity: 0.6; }
[data-variant="pass"] .ml-dribble__ball i:nth-child(1) { left: 0; }
[data-variant="pass"] .ml-dribble__ball i:nth-child(2) { left: 7.5px; }
[data-variant="pass"] .ml-dribble__ball i:nth-child(3) { left: 15px; }
[data-variant="pass"] .ml-dribble__ball b {
  width: 6px; height: 6px; left: -1.5px; bottom: 1.5px;
  animation: ml-dribble-pass calc(var(--ml-beat) * 4) var(--ml-ease-kick) infinite;
}
@keyframes ml-dribble-pass {
  0%, 8% { translate: 0 0; }
  20% { translate: 3.75px -6px; }
  25%, 33% { translate: 7.5px 0; }
  45% { translate: 11.25px -6px; }
  50%, 58% { translate: 15px 0; }
  70% { translate: 11.25px -6px; }
  75%, 83% { translate: 7.5px 0; }
  95% { translate: 3.75px -6px; }
  100% { translate: 0 0; }
}

/* Rondo: six marks round a circle, each lights as the ball reaches it */
[data-variant="rondo"] .ml-dribble__ball i {
  width: 4px; height: 4px; left: 7px; top: 7px;
  transform: rotate(calc(var(--i) * 60deg)) translateY(-7px);
  opacity: 0.2;
  animation: ml-dribble-rondo calc(var(--ml-beat) * 2) linear infinite;
  animation-delay: calc(var(--i) * var(--ml-beat) / 3 - var(--ml-beat) * 2);
}
@keyframes ml-dribble-rondo {
  0% { opacity: 1; }
  40%, 100% { opacity: 0.2; }
}

/* Floodlight sweep: a light band crosses the label every three beats.
   The text is painted through its background (background-clip: text), so the box has to reach the
   descenders of g, p, y: padding gives the room, the negative margin keeps the layout the same. */
.ml-dribble__label {
  padding-block: 0.2em;
  margin-block: -0.2em;
  color: transparent;
  background: linear-gradient(100deg, var(--ml-fg-muted) 35%, var(--ml-fg) 50%, var(--ml-fg-muted) 65%) 100% 0 / 300% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  animation:
    ml-dribble-sweep calc(var(--ml-beat) * 3) linear infinite,
    ml-dribble-label var(--ml-dur-base) var(--ml-ease-settle) both;
}
@keyframes ml-dribble-sweep { to { background-position: 0 0; } }
@keyframes ml-dribble-label { from { opacity: 0; translate: 0 0.4em; } }

.ml-dribble__time {
  font-family: var(--font-geist-mono), ui-monospace, monospace;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  color: var(--ml-fg-muted);
}

@media (prefers-reduced-motion: reduce) {
  .ml-dribble__ball b, .ml-dribble__ball i { animation: none !important; }
  [data-variant="rondo"] .ml-dribble__ball i { opacity: 0.6; }
  .ml-dribble__label { animation: none; color: var(--ml-fg-muted); background: none; }
}