Cursor Buddy, animated React component
A soft little character whose eyes follow the pointer anywhere on the page, sliding round its curved face and narrowing near the edge. It blinks, flinches when you come close, dozes off when left alone, and hops with a squash and stretch when you click it or press Enter.
- Pro
- Motion Effects
- Hover
- Spring
- 3D
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| shape | "squircle" | "pill" | "circle" | "squircle" | Silhouette of the character. |
| fill | "light" | "dark" | string | "light" | Body colour: the light or dark preset, or any CSS colour. |
| eyes | "dots" | "slits" | "squares" | "dots" | Eye style. |
| size | number | 120 | Height of the body in px. The pill is wider than it is tall. |
| follow | number | 60 | How far the head turns towards the pointer, 0 to 100. |
| sleepAfter | number | 9000 | Falls asleep after this many ms without pointer movement. 0 keeps it awake. |
| eyeColor | string | — | Eye colour. Defaults to ink on light bodies and white on dark ones. |
| poke | boolean | true | Click, tap, Enter or Space makes it hop. Turn off for a purely decorative buddy. |
| onPoke | () => void | — | Called after each poke. |
| autoplay | boolean | false | Looks around and hops now and then until the pointer first moves. |
| className | string | — | Classes for the outer wrapper. |
Add it to your project
- 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 createscomponents.jsonand thecn()helper insrc/lib/utils.ts:npx shadcn@latest init -d
Starting from nothing? The Quick Start walks through the whole thing.
- 2
Connect the registry with your API key
Cursor Buddy is a Pro item, so the CLI has to send your API key. Do this once per project:
- Create a key at nexus-ui.com/dashboard/api-key. Copy it straight away: it starts with
nxs_and is shown only once. - In your project root, next to
package.json, create a file named.env.localwith this line, using your own key:NEXUS_API_KEY=nxs_your_key_here
- Open
components.jsonand 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}" } } }
- Create a key at nexus-ui.com/dashboard/api-key. Copy it straight away: it starts with
How Cursor Buddy works
A soft little character whose eyes follow the pointer anywhere on the page. The eyes sit on the curved face, so they slide round it and narrow near the edge as the head turns. It blinks now and then, flinches when the pointer comes very close, dozes off when left alone, and hops with a squash and stretch when you poke it.
The source, the install command and the build prompt come with Pro.