Live Preview
See your app running in real-time as the AI generates code.
WebApp Preview
How It Works
- Instant Rendering: Code is rendered in an iframe as it's generated
- Hot Reload: Changes appear immediately without refresh
- Isolated Environment: Runs in a sandboxed iframe for security
Preview Features
- Full HTML/CSS/JavaScript execution
- React component rendering
- Responsive design testing
- Console output (errors, logs)
- Network requests (with CORS handling)
Preview Controls
- Refresh: Reload the preview
- Open in New Tab: View fullscreen
- Responsive Toggle: Test mobile/tablet/desktop views
- Console: View JavaScript errors and logs
Mobile App Preview
Expo Go Integration
Mobile apps use Expo Go for live preview on real devices.
Setup
- Install Expo Go on your iOS/Android device
- Generate your app in Prompt To App
- Scan the QR code with Expo Go
Features
- Real Device Testing: Run on actual iOS/Android hardware
- Hot Reload: Changes sync instantly to your device
- Native APIs: Camera, location, notifications work
- Debugging: Shake device to open dev menu
QR Code
┌─────────────────────┐
│ │
│ [QR CODE HERE] │
│ │
└─────────────────────┘
Scan with Expo Go app
Snack Preview (Web)
For quick testing without a device:
- Web Preview: Runs in browser (limited native features)
- iOS Simulator: Requires Expo account
- Android Emulator: Requires Expo account
Extension Preview
Chrome DevTools Integration
Extensions preview in a simulated Chrome environment.
Features
- Popup Preview: See your extension popup
- Content Script Testing: Test on sample pages
- Background Script Logs: View service worker output
- Storage Inspector: Check chrome.storage data
Preview Modes
- Popup: Extension icon click simulation
- Content Script: Injected into test page
- Options Page: Extension settings page
- DevTools Panel: Custom DevTools tab
Preview Limitations
WebApp
- ✅ Full HTML/CSS/JS support
- ✅ React, Vue, Svelte rendering
- ✅ API calls (with CORS)
- ❌ Server-side code (Node.js)
- ❌ File system access
- ❌ Native modules
Mobile
- ✅ React Native components
- ✅ Expo SDK (camera, location, etc.)
- ✅ Navigation (React Navigation)
- ❌ Custom native modules
- ❌ iOS/Android specific code (without Expo)
- ❌ Background tasks (limited)
Extension
- ✅ Popup, content scripts, background
- ✅ Chrome APIs (storage, tabs, etc.)
- ✅ Manifest V3 features
- ❌ Real browser extension installation
- ❌ Cross-origin requests (without permissions)
- ❌ Native messaging
Troubleshooting
WebApp Preview Not Loading
- Check browser console for errors
- Verify no syntax errors in generated code
- Try refreshing the preview
- Check for CORS issues with external APIs
Mobile Preview Not Connecting
- Ensure device and computer are on same network
- Check Expo Go app is up to date
- Verify QR code is scanning correctly
- Try restarting Expo Go app
Extension Preview Issues
- Check manifest.json is valid
- Verify permissions are correct
- Look for errors in background script logs
- Test in actual Chrome extension (export and load)
Best Practices
Testing Workflow
- Generate Code: Let AI create your app
- Preview Immediately: Check basic functionality
- Iterate: Ask AI to fix issues you see
- Test Thoroughly: Try all features in preview
- Export: Download when satisfied
Responsive Testing
1. Start with desktop view (default)
2. Toggle to tablet (768px)
3. Toggle to mobile (375px)
4. Test all breakpoints
5. Ask AI to fix responsive issues
Performance Testing
- Monitor console for errors
- Check network tab for slow requests
- Test on slower devices (mobile)
- Verify animations are smooth
Advanced Features
Custom Preview Settings
Some projects support custom preview configuration:
{
"preview": {
"port": 3000,
"host": "localhost",
"https": false,
"cors": true
}
}
Preview Debugging
Enable debug mode to see detailed logs:
- Open browser DevTools
- Go to Console tab
- Filter for "preview:" logs
- See render events, errors, warnings