Calm motion: animations on this site only fade, with no movement
PresenceCursors
The live pointers of other people over an area
Shows where other people point in a shared document, board, or canvas, each with a name tag. The component only draws. Your app sends the positions to the server and back, for example with a Phoenix channel and Presence. To list who is here, use an avatar group too.
Basic
Storyboard, scene 3. Move your pointer here.
You: outside
- Put the shared content in the default slot.
cursorsis a list of{ id, name, x, y, color }.xandygo from 0 to 1 across the area, so people with screens of different sizes agree.xcounts from the start edge, so a right-to-left page works too. movesends the local pointer in the same form, andnullwhen the pointer leaves. It sends on each pointer move, so limit what you send, for example once per animation frame. Settracktofalseto stop it.- Each person gets one of the chart colors from their
id, so the color stays the same between renders. Setcolorto a token name or any CSS color to choose it. - A tag moves to its new spot with a short transition, and with no transition under reduced motion.
- The layer is hidden from screen readers, because pointer positions have no meaning without sight. Say who is here in words, for example with an avatar group.
Usage
ts
import { BlessPresenceCursors, type BlessPresenceCursor } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
cursors* | BlessPresenceCursor[] | — | the other people's pointers; leave out the local one |
track | boolean | true | report the local pointer with `move` |
Events
| Name | Payload | Description |
|---|---|---|
move | [at: { x: number; y: number; } | null] |
Slots
| Name | Scope | Description |
|---|---|---|
default | — |