Skip to content

NewMCP server for your coding agent. Set it up ›

Nexus UI
Get Pro

Step Player, animated React component

  • Pro
  • Inputs & Controls
  • Spring

An onboarding player: the current step's dot stretches into a bar that fills while it plays, then eases over to the next dot as a small wave runs through the ones ahead. Play, pause, or tap a dot to jump to a step.

Props

PropTypeDefaultWhat it does
accent"#0071e3"Colour of the filling bar, finished dots and the "Step n of m" line.
stepsDEFAULT_STEPSSteps to play through, each { t: title, b: one-line body }.
stepDuration3.2Seconds each step plays before moving on.
autoplaytrueStarts playing on mount. Set to false to start paused; the play button still works.

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

    Step Player 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 Step Player works

Onboarding player. The current step's dot stretches into a bar that fills small wave runs through the ones ahead. Play, pause or tap a dot to jump.

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

Step Player questions

How do I install Step Player?

Run `npx shadcn@latest add @nexus-labs/step-player`. It installs framer-motion. Step Player 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 the steps and the color?

Pass `steps` as objects of `{ t, b }`, a title and a one-line body, in the order they play. `accent` (default `#0071e3`) colors the filling bar, finished dots and the "Step n of m" line. An empty array renders nothing.

How long does each step last, and does it loop?

`stepDuration` is in seconds and defaults to 3.2. After the last step it wraps back to the first. `autoplay` defaults to `true`; pass `autoplay={false}` to start paused, and the play button still works.

Can people jump to a step?

Yes. Each dot is a button with `role="tab"` labelled with the step title. Selecting one jumps there and restarts its progress bar. The round button plays and pauses. There is no callback for the current step.

Can I pass a className or change the width?

No. The props are `accent`, `steps`, `stepDuration` and `autoplay`, and the card is a fixed 320px wide. To resize it, edit the width class in the copied source file.

Guides