Skip to content

No.223 · Cursors

Presence Cursors

Other people, in the room. Collaborators' cursors move like hands — curved paths, a little overshoot, a settle, a faint tremor at rest — and act on the board: selecting a note in their colour, dragging it, typing in a bubble at their cursor. Press / to say something at yours.

The prompt

Copy this text

Automatic copying is unavailable. Copy the selected text using your device’s copy command.

Written for the variant you picked above: Paper

Build a multiplayer presence layer: a wrapper that draws collaborators' cursors over a board and lets the local user post cursor-chat messages. People: { id, name, color, script, offset? } where a script is a looping list of steps { to, dwell, act?, text? }. A target is either { pid, fx?, fy? } — an element in the board marked data-pid (or data-home, a fixed placeholder for returning something exactly) at a fraction of its box, defaulting to a seeded point in the middle third, because people point at words — or { x, y } as fractions of the host. Acts on arrival: select (the element gets data-by, --by colour and data-by-name, drawn as a 2px outline with the name tag on its corner), deselect, grab (select and carry: the element's translate follows the cursor's movement), drop, chat (type text into a bubble). Motion, per person, in one rAF loop (paused offscreen and when the tab is hidden): each move is a cubic Bézier from the current point to the target, bowed to one side by up to a fifth of its length, with duration 260 + 170·log₂(1 + d/30) ms (Fitts-like) and ease-in-out-cubic. The drawn cursor follows that path through a spring (k 210, ζ 0.7), which adds the small overshoot and settle of a real hand. While resting it carries a sub-pixel tremor (two sines). Cursor: a 20px arrow in the person's colour with a white keyline (paint-order stroke) and a name pill. Chat bubble: under the pill, typed at 55ms per character with a blinking caret, held for 2.6s, then released; the person's status reads Editing, Moving a note, Typing or Viewing. You: press / while the pointer is over the board (or focus is inside it) to open a labelled input at your pointer, or the centre from the keyboard. Enter posts a bubble in your colour that fades after 3.6s; Escape or blur cancels. A "Say something /" button opens the same input for touch and keyboard users. An avatar stack lists everyone with their status as visually hidden text. Coordinates are host-local and corrected for scaled hosts. Paper and Night boards. Selected variant — Paper (paper): Palette for this theme (Paper): --presence-cursors-bg #f6f5f1; --presence-cursors-chip #ffffff; --presence-cursors-ink #1d1c19; --presence-cursors-line rgb(0 0 0 / 0.1); --presence-cursors-ring #f6f5f1. Treat these as the root colour tokens, one value per role, and name them to suit your code. Select it with the theme option set to "paper". Keep every dimension, spacing value, state and motion from the brief unchanged, and keep text at 4.5:1 contrast or better on these surfaces. This selection takes precedence over references to other themes or options in the general brief. Implement this selected appearance; do not add a variant picker or alternative appearances unless requested. Implementation requirements: Use React and TypeScript. Keep the component self-contained, with uniquely scoped CSS and no animation libraries. Include required imports, styles and font setup in the result. Interaction: Watch Maryam select, Yousef drag a note across and back, and Aisha type. Press / (or the Say something button) to post a message at your cursor. Motion: Bézier paths with Fitts-like timing through a spring (k 210, ζ 0.7); tremor at rest; chat types at 55ms per character; selection outline 160ms; your bubble fades after 3.6s. Accessibility: The cursors are aria-hidden decoration; the avatar list names everyone with what they're doing. Cursor chat is a labelled text input reachable by keyboard (/ or the button), Enter posts and Escape cancels. Reduced motion jumps cursors between rest points and shows messages whole, with no glide, tremor or caret. Responsive behavior: Targets are elements and fractions, re-measured on every move, so scripts keep working as the columns stack on phones. Touch: The collaborators keep moving; the Say something button opens cursor chat without a keyboard shortcut. Preserve keyboard access, visible focus and reduced-motion behavior. Keep fictional demo data and simulated service calls in a separate usage example; expose callbacks for real actions and recover from rejected requests. Keep usage-example links inside the demo: use local buttons or prevent navigation. Demonstration links must not navigate to Vitrine routes or open other pages; preserve real URL support in the reusable component itself. Verify the result at narrow and wide viewport sizes, with keyboard input and reduced motion enabled.

Notes

Interaction
Watch Maryam select, Yousef drag a note across and back, and Aisha type. Press / (or the Say something button) to post a message at your cursor.
Motion
Bézier paths with Fitts-like timing through a spring (k 210, ζ 0.7); tremor at rest; chat types at 55ms per character; selection outline 160ms; your bubble fades after 3.6s.
Accessibility
The cursors are aria-hidden decoration; the avatar list names everyone with what they're doing. Cursor chat is a labelled text input reachable by keyboard (/ or the button), Enter posts and Escape cancels. Reduced motion jumps cursors between rest points and shows messages whole, with no glide, tremor or caret.
Responsive
Targets are elements and fractions, re-measured on every move, so scripts keep working as the columns stack on phones.
On touch
The collaborators keep moving; the Say something button opens cursor chat without a keyboard shortcut.