Skip to content

NewMCP server for your coding agent. Set it up ›

Nexus UI
Get Pro

Marble Progress, animated React component

  • Pro
  • Cards
  • Spring

An onboarding checklist that keeps score with marbles: tick a step and a marble of its colour rolls down three ramps into a jar, untick it and that marble pops. When every step is done the jar glows.

Ticks when you check a step, clicks off when you uncheck and rings a short chord when the last step completes. Sound is off on this site until you switch it on.

Props

PropTypeDefaultWhat it does
steps5 setup stepsEach step has a label (unique) and a color (6-digit hex) used for its checkbox and marble.
autoplayfalseTicks the steps one by one, then clears them, until someone clicks a step. Off under reduced motion.
marbleSize9Radius in px of each marble as it drops. Clamped to 6 to 11. Applies to the next marble dropped.
bounciness0.45How much a marble bounces when it lands. Clamped to 0.05 to 0.85. Applies to the next marble dropped.
gravity1How hard gravity pulls. Lower drifts down slowly, higher rattles through. Clamped to 0.4 to 1.6.
glowColor"#30d158"Colour (6-digit hex) of the light that fills the jar when every step is done.
enableSoundtruePlays interface sounds on interaction. They follow the sound switch (setSoundsEnabled, on by default) and stay silent on hover. Autoplay makes the same sounds once the visitor has used the page. Pass false to silence this component.

Add it to your project

  1. 1

    Set up your project once

    You need a Next.js project with Tailwind CSS and the @/ import alias. In its root folder, run this once. It creates components.json and the cn() helper in src/lib/utils.ts:

    npx shadcn@latest init -d

    Starting from nothing? The Quick Start walks through the whole thing.

  2. 2

    Connect the registry with your API key

    Marble Progress is a Pro item, so the CLI has to send your API key. Do this once per project:

    1. Create a key at nexus-ui.com/dashboard/api-key. Copy it straight away: it starts with nxs_ and is shown only once.
    2. In your project root, next to package.json, create a file named .env.local with this line, using your own key:
      NEXUS_API_KEY=nxs_your_key_here
    3. Open components.json and add this entry inside the outermost braces, next to "aliases". Leave {name} and ${NEXUS_API_KEY} exactly as written; the CLI fills them in:
      "registries": {
        "@nexus-labs": {
          "url": "https://www.nexus-ui.com/api/registry/{name}",
          "headers": {
            "Authorization": "Bearer ${NEXUS_API_KEY}"
          }
        }
      }

How Marble Progress works

An onboarding checklist that keeps score with marbles. Tick a step and a untick it and that marble pops. When the jar is full it lights up.

The source, the install command and the build prompt come with Pro.

Marble Progress questions

How do I install Marble Progress?

Run `npx shadcn@latest add @nexus-labs/marble-progress`. It installs framer-motion and matter-js, the physics engine that moves the marbles. It is a Pro component, so it needs a Pro plan and an API key; key setup is on the CLI docs page (/docs/cli).

How do I set my own checklist steps?

Pass `steps` as an array of `{ label, color }`, where `color` is a 6-digit hex used for the checkbox and its marble. Labels are used as React keys, so keep them unique. Ticked state lives inside the component and there is no `onChange` or controlled prop, so edit the source if you need to save progress.

Which props change the marble physics?

`marbleSize` is the radius in px (default 9, clamped 6 to 11), `bounciness` defaults to 0.45 (0.05 to 0.85) and `gravity` defaults to 1 (0.4 to 1.6). `glowColor` (default `#30d158`) sets the light that fills the jar when every step is done.

Is it canvas or WebGL, and is the checklist accessible?

The ramps, jar and marbles are drawn on a 2D canvas with Matter.js, and the canvas is hidden from screen readers. Each step is a button with `role="checkbox"` and `aria-checked`, and the "of" counter is a polite live region. With reduced motion on, only `autoplay` is turned off, so marbles still drop when someone ticks a step.

Does it make sound, and how do I turn it off?

Ticks when you check a step, clicks off when you uncheck and rings a short chord when the last step completes. Sounds are synthesised with the Web Audio API, so there are no audio files, and they only play after a click or key press. Pass `enableSound={false}` to silence this component, or call `setSoundsEnabled(false)` from `@/lib/ui-sounds` to switch every sound off at once. The CLI installs `@/lib/ui-sounds` with the component.