Using the ClipVibe Code Editor
Mastering the built-in editor: Live preview, Safe Mode, and dealing with external imports.
The ClipVibe Code Editor is designed for speed. It's not a full VS Code environment, but a focused "Sandpack" for single-file web apps.
Key Features
1. Auto-Detection
Paste raw code, and we figure it out.
- HTML: Detected by
<!DOCTYPE html>or<html>tags. - React: Detected by
import Reactor functional component syntax.
2. Live Preview
The preview pane updates automatically as you type (with a slight debounce).
- For React: We compile it in-browser using a secure sandbox.
- For HTML: We inject it into a sandboxed iframe.
3. Safe Mode
To protect you from malicious code, the Editor runs in strict isolation.
- No Cookies: The preview cannot access your main ClipVibe session cookies.
- No External Navigation: The preview cannot redirect the main window.
Common Actions
Modifying AI Code
Often, AI gets it 90% right. You can make small tweaks directly here.
- Change Colors: Find
className="bg-blue-500"and change it tobg-red-500. - Fix Typos: Edit the text directly in the code.
"Reset" vs "Clear"
- Clear: Wipes the editor blank.
- Revert (in Version History): Restores the file to the last saved state on the server.
Troubleshooting
If the preview goes white/blank:
- Check the Console (Developer Tools) for syntax errors.
- Ensure you aren't using local imports (e.g.,
import X from './file'). - Check if you closed all your tags (
</div>).