ProUnlock everything for $49.99 a year, or $79.99 once. See plans ›

Nexus UI

Venom Button, animated React component

A glossy black pill that hunts for a host. Come near and pseudopods ooze out and feel toward the cursor; get close and they lunge, each one wrapping a finger of a cartoon glove. Pull away and they stretch, snap and melt back into the button, which wobbles and throws up a few spikes.

  • Free
  • Inputs & Controls
  • Hover
  • Spring

Play with it

Move the controls and watch it change. Copy code gives you a snippet with only the props you changed.

Props

PropTypeDefaultWhat it does
label"let’s collaborate"Text on the button.
onClick—Click handler. It is a real button, so it is focusable and works from the keyboard.
strands7Thick strands, 2 to 7. About as many fine hairs are added between them.
sense290Distance from the edge, in px, at which the goo notices the cursor and starts reaching for it.
reach140Distance from the edge, in px, at which the strands lunge and grab the fingers.
release215Distance from the edge, in px, at which they snap. Keep it above reach.
cursor"glove""glove" draws a cartoon hand inside the stage; "native" keeps the system pointer.
height420Stage height in px.
autoplayfalseA ghost glove plays with the button until a real pointer arrives. Pauses off screen and never runs under reduced motion.
className—Extra classes for the stage.

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

    Run this once per project. It writes the Nexus UI entry into components.json for you:

    npx shadcn@latest registry add "@nexus-labs=https://www.nexus-ui.com/api/registry/{name}"

    Type it exactly as shown. {name} is filled in by the CLI with the component you ask for, so you never replace it.

  3. 3

    Add the component

    Run this from your project root. It adds the component, the helpers it imports and its npm packages.

    npx shadcn@latest add @nexus-labs/venom-button
  4. 4

    Check what was added

    With a project made as in the Quick Start (a src/ folder), these files land in it:

    components/
    venom-button/
    index.ts
    venom-button.tsx
  5. 5

    Copying by hand? Skip the registry

    Instead of steps 2 and 3 you can copy the files yourself, with no registry and no API key. Step 1 still applies, so that cn() exists. Install the packages:

    npm install framer-motion

    Then show the source and create each file at the path it gives:

  6. 6

    Use it in a page

    Installing only adds the files. Import the component in a page and render it. The Usage tab on the preview shows a fuller example with props:

    // src/app/page.tsx
    import { VenomButton } from "@/components/venom-button";
    
    export default function Page() {
      return (
        <main>
          <VenomButton />
        </main>
      );
    }