Skip to content

NewMCP server for your coding agent. Set it up ›

Nexus UI
Get Pro

Island Morph, animated React component

A black pill that morphs between a timer, an incoming call and a full music player, with each state's content blurring in once the shape lands.

  • Pro
  • Motion Effects
  • Spring

Whooshes softly when you press a state button, Accept or Decline. Sound is off on this site until you switch it on.

Props

PropTypeDefaultWhat it does
autoplayfalseCycles through idle, timer, call and music until a control is pressed.
stiffness380How firmly the pill springs to its next shape, 120 to 800. Higher is snappier.
damping30How quickly the pill settles, 10 to 60. Lower overshoots and wobbles, higher stops dead.
blur10How blurry the content is as it fades in and out, in px, 0 to 24. 0 is a plain fade.
contentDelay0.08Seconds the content waits for the shape to land before it appears, 0 to 0.6.
surface"#000000"Colour of the pill. Any CSS colour; keep it dark so the white content stays readable.
timerColor"#ff9f0a"Colour of the timer's clock icon and numbers. Any CSS colour.
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

    Island Morph 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}"
          }
        }
      }

Island Morph questions

How do I install Island Morph?

Run `npx shadcn@latest add @nexus-labs/island-morph`. It installs framer-motion. Island Morph is a Pro component, so it needs a Pro plan and an API key; key setup is on the CLI docs page (/docs/cli).

Which states does it have, and how do I switch them?

Four: idle, timer, call and music. The segmented control under the pill switches them, and in the call state Accept goes to timer and Decline to idle. `autoplay` (off by default) cycles them until a control is pressed.

Can I change the caller, song or timer?

Not through props; `autoplay` is the only behavior prop. The caller "Alex Rivera", the song "Night Drive" and the demo countdown are written in the file, so edit them there. The pill sizes per state live in the `SIZES` object.

How does the morph work?

One black element animates its width, height and border radius with a spring. Each state's content is swapped with AnimatePresence and blurs in a moment after the shape starts to move. It uses Framer Motion and no other library.

Which controls actually do something?

Accept and Decline move between states, and the Play and Pause button toggles the music animation. Previous and Next in the music state are visual only. The pill is a `role="status"` live region, so state changes are announced.

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

Whooshes softly when you press a state button, Accept or Decline. 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.