# SmoothCursor

> Multiplayer-style cursor: an upright coloured arrow with a white rim follows the pointer on a spring, and a name pill trails it on a softer spring and dims when idle.

- Package: `fancy-ui-react` (React 18/19 + Tailwind CSS v4)
- Category: Effects
- Tags: cursor, animation, spring, physics, interactive, multiplayer, collaboration, presence
- Types: `SmoothCursorProps`, `SpringConfig`
- Docs: https://fancy-ui.rama.app/docs/components/smooth-cursor
- Source: https://github.com/RamaHerbin/fancy-ui/tree/main/react/src/components/smooth-cursor

## Import

```tsx
import { SmoothCursor } from 'fancy-ui-react';
```

Setup (once per project): `npm install fancy-ui-react`, then put these lines in your main CSS file (the stylesheet import goes right after `@import "tailwindcss";`):

```css
@import "tailwindcss";
@import "fancy-ui-react/tailwind.css";
```

and import the component styles once in the app entry: `import "fancy-ui-react/styles.css";`. Full guide: https://fancy-ui.rama.app/llms.txt

The names below are the ones to write in React; when one differs from the Svelte name, the Svelte name follows in parentheses. `class` becomes `className`, a callback takes the name the React port declares (`onclick` becomes `onClick`), snippets become `ReactNode` props (render functions when they take arguments) and the default snippet is `children`. Divergences: https://github.com/RamaHerbin/fancy-ui/tree/main/react#divergences-from-the-svelte-api

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `springConfig` | `SpringConfig` | `{}` | Spring physics configuration with damping, stiffness, and mass |
| `label` | `string` | `undefined` | Name shown in a pill that trails the arrow on its own softer spring. No pill when omitted. |
| `color` | `string` | `"#0e9f6e"` | Fill colour of the arrow and the name pill (any CSS colour). Can also be overridden from a class with --smooth-cursor-color. |
| `rotate` | `boolean` | `false` | Rotate the cursor toward its direction of travel (pivoting on its centre). When false, the arrow stays upright with its tip as the hotspot. |
| `idleFade` | `number` | `1500` | Milliseconds without pointer movement before the name pill dims to 35% opacity; 0 disables it. |
| `labelSpring` | `SpringConfig` | `derived` | Spring for the name pill. Missing fields derive from springConfig (stiffness × 0.55, damping × 1.1, same mass). |

## Node props

| Prop | Description |
| --- | --- |
| `cursor` | Custom cursor element (replaces the default arrow; the name pill still renders when label is set) |

## Example

No React example is published for this component yet: start from the import above and the props table. The full examples are Svelte-only, on https://fancy-ui.rama.app/docs/components/smooth-cursor.md.
