Canvas Overview
The canvas is an unlimited 2D workspace that supports:- Infinite panning and zooming
- Multiple layer types (shapes, text, notes)
- Real-time collaboration with live cursors
- Undo/redo with full history tracking
- Object selection, transformation, and styling
The canvas has a maximum limit of 100 layers per board to ensure optimal performance.
Drawing Tools
Access the toolbar on the left side of the canvas to select different tools and modes.Selection Tool
The default mode for interacting with objects on the canvas.Click objects to select
Click any shape, text, or note to select it. Selected objects show resize handles and a colored border.
app/board/[boardId]/_components/canvas.tsx:96-123:
Shape Tools
Create various shapes on your canvas:Rectangle
Create rectangular shapes for diagrams, wireframes, and layouts.
Ellipse
Draw circular and elliptical shapes for flowcharts and diagrams.
Text
Add text labels and annotations to your board.
Sticky Note
Create sticky notes for brainstorming and organizing ideas.
Inserting Layers
When you select a shape tool and click on the canvas, a new layer is created with these default properties:- Position: Where you clicked on the canvas
- Size: 100x100 pixels
- Color: Last used color (defaults to red)
app/board/[boardId]/_components/canvas.tsx:62-94:
Canvas Interactions
Panning
Navigate around the infinite canvas:- Mouse wheel: Scroll vertically and horizontally to pan
- Trackpad: Use two-finger swipe to pan in any direction
app/board/[boardId]/_components/canvas.tsx:195-200:
Multi-Selection
Select multiple objects simultaneously:- Click and drag on an empty area of the canvas
- A blue selection rectangle appears
- All objects within the rectangle are selected
- Release to complete the selection
app/board/[boardId]/_components/canvas.tsx:131-149:
Resizing Objects
Resize selected objects using corner handles:- Click and drag any of the 8 resize handles
- Objects resize from the opposite corner
- Proportions can be freely adjusted
app/board/[boardId]/_components/canvas.tsx:161-181:
Selection Tools
When you select one or more objects, a floating toolbar appears above the selection with additional options.Color Picker
Change the fill color of selected objects:- Choose from preset colors
- Apply color to all selected objects simultaneously
- Color choice is remembered for new objects
app/board/[boardId]/_components/selection-tools.tsx:66-76:
Layer Ordering
Control the z-index of objects:Bring to Front
Move selected objects to the top of the layer stack, appearing above all other objects.
Send to Back
Move selected objects to the bottom of the layer stack, appearing behind all other objects.
app/board/[boardId]/_components/selection-tools.tsx:23-64:
Deleting Objects
Remove selected objects from the canvas:- Click the trash icon in the selection toolbar
- Press the Delete key (when implemented)
- Deletion is added to the undo history
History Management
The canvas includes full undo/redo support for all operations.Keyboard Shortcuts
| Action | Windows/Linux | Mac |
|---|---|---|
| Undo | Ctrl+Z | Cmd+Z |
| Redo | Ctrl+Shift+Z | Cmd+Shift+Z |
app/board/[boardId]/_components/canvas.tsx:306-327:
History Tracking
These operations are tracked in the undo/redo history:- Creating new layers
- Moving objects
- Resizing objects
- Changing colors
- Deleting objects
- Changing layer order
History is paused during active operations (like dragging) and resumed when the operation completes to prevent cluttering the history stack with intermediate states.
Canvas Modes
The canvas operates in different modes defined intypes/canvas.ts:1-9:
Layer Types
The canvas supports five layer types defined intypes/canvas.ts:22-28:
x,y: Position on the canvaswidth,height: Dimensionsfill: RGB color objectvalue: Optional text content (for text and note layers)
Performance Considerations
Layer Limit
Layer Limit
The 100 layer maximum ensures smooth performance even with complex boards. This limit is enforced at
app/board/[boardId]/_components/canvas.tsx:40.Render Optimization
Render Optimization
Only visible layers within the viewport are actively rendered. The SVG-based rendering provides hardware-accelerated performance.
Real-time Throttling
Real-time Throttling
Updates are throttled to 16ms (60fps) to balance responsiveness with network efficiency, configured in
liveblocks.config.ts:11-12.Next Steps
Collaboration
See how multiple users work together on the canvas
Boards
Learn about creating and managing boards