Home / Companies / Upstash / Blog / Post Details
Content Deep Dive

Figma-Style Live Cursors with Next.js 16 & Upstash Realtime

Blog post from Upstash

Post Details
Company
Date Published
Author
Josh
Word Count
2,082
Company Posts That Month
4
Language
English
Hacker News Points
-
Post removed?
No
Summary

A detailed guide explains how to create real-time, Figma-style live cursors for a web application using Next.js, Upstash Realtime, and TypeScript. The process involves setting up a Realtime instance to batch cursor positions, which reduces network overhead and memory usage. A custom `useCursors` hook handles the batching of outgoing cursor positions and animates other users' cursors using `requestAnimationFrame` for smooth 60-FPS animations. Cursor components are developed to display other users' cursors and replace the current user's default cursor with a custom one. Utility functions are used for generating random usernames and consistent colors. The implementation includes setting up API routes to manage real-time events and integrating all components on the main page. The batching strategy is highlighted as an efficient and cost-effective method, with a suggestion to test the feature by opening the app in two browser windows to observe the live cursor interactions.

Trends Found in this Post
Trend Post Mentions Total Month Mentions Posts Companies MoM
Real-time 31 7,285 1,202 224 +60%
Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.