Realtime UI
Example

Build collaborative applications with live multiplayer editing, real-time syncing, and interactive features.

Realtime Features

Multiplayer

Enable real-time collaboration with live cursor tracking and shared editing sessions.

Live Sync

Automatic state synchronization across all connected users with latency compensation.

Interactivity

Dynamic UI updates with instant feedback on user interactions and state changes.

The Code

1. Project Structure

realtime-ui ├── index.canvas │ └── main.280 ├── manifest.json ├── assets/ └── .280/ └── config.json

2. Realtime Script (main.280)


// Initialize collaborative canvas
const canvas = Canvas.create({
    width: 1200,
    height: 800,
    theme: 'collaborative',
    backgroundColor: '#2e2e2e'
});

// Add real-time features
canvas.enableMultiplayer({
    userCursor: true,
    autoSync: true,
    latencyCompensation: 200
});

// Create interactive elements
const whiteboard = Whiteboard.create({
    tools: ['text', 'draw', 'shape'],
    permissions: { edit: 'all', share: 'owner' }
});

const chat = Chat.create({
    position: { right: 32, top: 32 },
    history: '280-rtui-demo'
});

// Add event handlers
canvas.on('user-join', (user) => {
    chat.postMessage(`Welcome ${user.name}`);
});

canvas.on('draw', (event) => {
    whiteboard.updateCanvas(event.position);
    chat.postMessage(`${event.user} is drawing`);
});

// Deploy to web and mobile
canvas.deploy({
    web: true,
    mobile: true
});

3. Live Demo

User A
User B

How It Works

Multiplayer Session

Instant setup for collaborative sessions with automatic peer discovery.

Live Updates

All changes are synced instantly with delta compression for efficiency.

Permissions

Granular control over who can edit, view, and share your projects.

Build Realtime Experiences

This example demonstrates collaborative UI with live editing, multiplayer support, and real-time synchronization.

Create Your Realtime App