AI Collaborative Canvas
AI
Results
Governor
Real-time collaborative workspace where humans and AI work together on visual content. Features live cursors, element attribution, AI suggestions, and permission controls for AI editing capabilities.
Minimal Variant
Compact collaborator presence indicator
Y
Y
J
AI editing
Standard Variant
Full canvas with toolbar and collaborators
Collaborative Canvas
Y
1 AI suggestions
100%
You is editing
2 elementsFull Variant
Canvas with collaborator sidebar
Collaborative Canvas
1 suggestions
100%
Canvas area
Click to add elements
People
Y
You (you)
editing
AI Assistants
AI Assistant
viewing
Props
AICollaborativeCanvas component API reference
| Prop | Type | Default | Description |
|---|---|---|---|
collaborators* | Collaborator[] | — | List of active collaborators (humans and AI) |
elements | CanvasElement[] | — | Canvas elements/objects |
currentUserId | string | — | Current user ID (to hide their cursor) |
activeTool | 'select' | 'pan' | 'text' | 'shape' | 'draw' | 'ai_assist' | 'select' | Currently selected tool |
onToolChange | (tool: CanvasTool) => void | — | Callback when tool changes |
onRequestAIAssist | (context: { selectedElements?: string[]; area?: Area }) => void | — | Callback when AI assistance is requested |
onElementSelect | (elementId: string) => void | — | Callback when element is selected |
onAcceptSuggestion | (elementId: string) => void | — | Callback when AI suggestion is accepted |
onRejectSuggestion | (elementId: string) => void | — | Callback when AI suggestion is rejected |
aiCanEdit | boolean | false | Whether AI has edit permissions |
onAIPermissionChange | (canEdit: boolean) => void | — | Callback when AI edit permission changes |
showCursors | boolean | true | Show collaborator cursors |
showToolbar | boolean | true | Show toolbar with tools |
variant | 'minimal' | 'standard' | 'full' | 'standard' | Display mode variant |
canvasSize | { width: number; height: number } | { width: 800, height: 600 } | Canvas dimensions |
className | string | — | Additional CSS classes |
Collaborator Type
| Prop | Type | Default | Description |
|---|---|---|---|
id* | string | — | Unique collaborator ID |
name* | string | — | Display name |
type* | 'human' | 'ai' | — | Collaborator type |
status* | 'active' | 'idle' | 'editing' | 'viewing' | — | Current status |
color* | string | — | Collaborator color |
avatar | string | — | Avatar URL |
cursorPosition | { x: number; y: number } | — | Cursor position |
activeElement | string | — | Currently selected element ID |
CanvasElement Type
| Prop | Type | Default | Description |
|---|---|---|---|
id* | string | — | Unique element ID |
type* | 'text' | 'shape' | 'image' | 'sticky' | 'drawing' | 'ai_suggestion' | — | Element type |
content | string | — | Element content |
position* | { x: number; y: number } | — | Position on canvas |
size* | { width: number; height: number } | — | Element dimensions |
createdBy* | string | — | Creator ID |
lastEditedBy | string | — | Last editor ID |
isLocked | boolean | — | Whether element is locked |
isAISuggestion | boolean | — | Whether this is an AI suggestion |
confidence | number | — | AI confidence (0-100) |
Usage
Import and implementation example
import { AICollaborativeCanvas } from '@/blocks/ai-transparency/ai-collaborative-canvas'
export default function DesignTool() { const [collaborators, setCollaborators] = useState([ { id: 'user1', name: 'You', type: 'human', status: 'editing', color: '#10b981', }, { id: 'ai1', name: 'AI Assistant', type: 'ai', status: 'viewing', color: '#6366f1', }, ])
const [elements, setElements] = useState([]) const [aiCanEdit, setAiCanEdit] = useState(false)
const handleAcceptSuggestion = (id: string) => { // Convert AI suggestion to regular element }
const handleRequestAIAssist = (context) => { // Generate AI suggestions }
return ( <AICollaborativeCanvas collaborators={collaborators} elements={elements} currentUserId="user1" aiCanEdit={aiCanEdit} variant="full" showCursors={true} showToolbar={true} onAcceptSuggestion={handleAcceptSuggestion} onRejectSuggestion={(id) => removeElement(id)} onAIPermissionChange={setAiCanEdit} onRequestAIAssist={handleRequestAIAssist} /> )}Built With
3 componentsThis block uses the following UI components from the design system:
Features
Built-in functionality
- Real-time collaboration: See other collaborators cursors and actions live
- Human-AI distinction: Visual differentiation between human and AI collaborators
- AI suggestions: Dashed outline for AI-suggested elements with accept/reject actions
- Permission control: Toggle AI edit permissions with lock/unlock button
- Tool palette: Select, pan, text, shape, draw, and AI assist tools
- Live cursors: Show collaborator names and cursor positions
- Element attribution: Track who created and last edited each element
- Zoom controls: Zoom in/out with percentage display
- Collaborator sidebar: Full variant includes detailed collaborator list
- Grid background: Dot grid for alignment and positioning
- Status indicators: Show editing/viewing/idle status for each collaborator
- Dark mode support: Full dark mode with proper contrast
Accessibility
ARIA support and keyboard navigation
ARIA Attributes
All tools use semantic button elementsCollaborator list uses proper list markupCanvas elements are keyboard accessibleKeyboard Navigation
| Key | Action |
|---|---|
| Tab | Navigate through tools and elements |
| V, H, T, S, D, A | Switch tools (shortcuts) |
| Enter / Space | Activate tools and actions |
| Arrow keys | Move selected elements |
Notes
- Collaborator types indicated by icons and colors
- AI suggestions have dashed borders and special badges
- Consider adding aria-live for real-time updates
- Canvas may need additional screen reader support