Hello,
I created a small React library to make adding presence (live cursors/live avatars) easy on any multiplayer application using Yjs. The library provides two react hooks useOthers
and useSelf
to retrieve presence information about the users connected to the room. More information/documentation about the hook is in the project repo.
Project Link: y-presence
Demos:
- Simple room: Demo | Code
- Live cursors: Demo | Code
- Live avatars: Demo | Code
- Live selection: Demo | Code
Any feedback is highly appreciated. The library is inspired by @steveruizok’s demo of perfect-cursors. I’ll soon add a demo with perfect-cursors at some point if anyone is interested. Also, the library is very much inspired by Liveblocks’s react implementation of their multiplayer API.