Skip to content

NewMCP server for your coding agent. Set it up ›

Nexus UI
Get Pro

Pulse Monitor, animated React component

  • Pro
  • Dashboards
  • Hover
  • Spring

A heart-rate card with a bedside-monitor ECG trace that sweeps and erases as it goes, a heart that beats on every spike and 24 hourly range bars you can scrub. Start a workout and the rate climbs, the beats close up and the colour warms.

Props

PropTypeDefaultWhat it does
bpm68Resting heart rate. Also seeds the day's hourly ranges; a workout climbs to max(bpm + 50, 120).
color"#ff375f"Colour of the trace, heart and range bars at rest.
workoutColor"#ff9f0a"Colour everything warms to, and the button fills with, during a workout.
autoplayfalseToggles a workout every ~10s and sweeps the hour readout along the bars until someone interacts.

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

    Pulse Monitor 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 Pulse Monitor works

A heart-rate card with a monitor trace. The ECG sweeps across like a bedside monitor, erasing as it goes, and the heart beats on every spike. Start a workout and the rate climbs, the beats close up and the colour warms. Run along the day's range bars (or use the arrow keys) to read any hour.

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

Pulse Monitor questions

How do I install the Pulse Monitor?

Run `npx shadcn@latest add @nexus-labs/pulse-monitor`. It installs framer-motion; the ECG trace is drawn on a 2D canvas and the 24 hourly range bars are regular DOM elements. 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).

Does it show real heart-rate data?

No. The beats-per-minute reading and the 24 hourly range bars are generated from the `bpm` prop (default 68) with a fixed pseudo-random seed, so a given `bpm` always gives the same day. There is no prop for feeding real samples, so change the `hourly` function in the source to use your own data.

How do I change the colors and the workout rate?

`color` sets the trace, heart and bars at rest (default `#ff375f`) and `workoutColor` is what everything warms to during a workout (default `#ff9f0a`). Start workout raises the rate to `max(bpm + 50, 120)` and speeds up the beats.

Is the hourly chart keyboard accessible, and does it respect reduced motion?

Yes. The range bars are a focusable `role="slider"` where the arrow keys step through the hours, Home and End jump to 00:00 and 23:00, Escape clears the selection, and a screen-reader-only live region announces the range. With prefers-reduced-motion on, the heart no longer pulses and the number fades instead of sliding, but the ECG trace keeps sweeping.