Appearance
Canvas
Interactive Canvas lets you create live HTML applications -- charts, dashboards, games, diagrams, forms, and UI mockups -- directly from chat. The canvas renders in a side panel with live preview, and you can iterate by typing follow-up requests.
Creating a Canvas
Ask GhostAI to build something visual:
- "Build me a sales dashboard"
- "Create a snake game"
- "Design a form for collecting feedback"
- "Make an architecture diagram of our microservices"
GhostAI generates the HTML, CSS, and JavaScript, then renders it in a sandboxed iframe alongside the chat. Edit iteratively -- GhostAI sees the current HTML and applies your changes.
Viewport Preview
Preview your canvas at different screen sizes using the viewport selector in the toolbar:
| Viewport | Width |
|---|---|
| Mobile | 375px |
| Tablet | 768px |
| Desktop | 1280px |
The preview frame is resizable for pixel-perfect testing.
Theme Toggle
Switch canvases between dark, light, and auto (system-matched) themes. Click the theme icon in the toolbar or press Ctrl/Cmd+Shift+T to cycle through options.
Dev Console
Open the built-in dev console to inspect console.log output, JavaScript errors, and network requests without opening browser DevTools. Press Ctrl/Cmd+Shift+D to toggle.
Self-Healing
When a canvas throws a runtime error, GhostAI detects the failure, diagnoses the issue, and generates a fixed version automatically. A banner shows what was fixed.
Templates
Start from pre-built templates instead of a blank canvas:
- Dashboard
- Chart
- Form
- Game
- Presentation
Access templates from the canvas creation flow or the template selector in the toolbar.
Canvas SDK
Canvases can use the ghostai.state API for persistent state that survives page refreshes. The API proxy (/api/canvas/proxy) lets canvases fetch live data from external APIs with CORS handled automatically.
Export Options
- Copy as image -- capture the canvas as a PNG screenshot
- Export as PDF -- print-ready PDF export
- Download HTML -- standalone HTML file
- Publish to GhostForge -- share as a discoverable app with PII scanning
See GhostForge for publishing details.
Performance and Accessibility
The toolbar shows real-time FPS, DOM node count, and memory usage. Run a one-click accessibility audit to check contrast, ARIA labels, keyboard navigation, and screen reader compatibility.
Keyboard Shortcuts
| Shortcut | Action |
|---|---|
| Ctrl/Cmd+E | Toggle edit mode |
| Ctrl/Cmd+Shift+F | Fullscreen canvas |
| Ctrl/Cmd+Shift+T | Cycle themes |
| Ctrl/Cmd+Shift+D | Dev console |
Security
Canvases render in a sandboxed iframe with Content Security Policy (CSP) restrictions. All canvas HTML is PII-scanned before persistence. External resource fetches route through /api/canvas/proxy with an allowlist to prevent SSRF.
Configuration
| Variable | Default | Description |
|---|---|---|
CANVAS_ENABLED | true | Master toggle |
CANVAS_MAX_SIZE | (default) | Maximum canvas HTML size |
CANVAS_RATE_LIMIT | (default) | Rate limit for canvas operations |
CANVAS_EXECUTION_TIMEOUT | (default) | Timeout for canvas generation |