A beautiful and modern web-based code editor built with Nuxt 3, Tailwind CSS, and Monaco Editor. Write HTML, CSS, and JavaScript with live preview and code persistence.
- 🎨 Modern UI: Beautiful gradient-based dark theme with smooth animations
- 💻 Monaco Editor: Full-featured code editor with syntax highlighting, IntelliSense, and code formatting
- 👁️ Live Preview: Real-time preview of your HTML, CSS, and JavaScript code
- 💾 Auto-save: Automatic saving to localStorage every 30 seconds
- 🔄 Code Persistence: Your code is preserved between sessions
- 🎯 Split View: Side-by-side editor and preview panels
- 📱 Responsive: Works on desktop and tablet devices
- ⚡ Fast: Optimized with Vite for lightning-fast development
- Nuxt 3 - The Intuitive Vue Framework
- Tailwind CSS - A utility-first CSS framework
- Monaco Editor - The code editor that powers VS Code
- Vue 3 - The Progressive JavaScript Framework
- Node.js 18.x or higher
- npm or yarn
- Clone the repository:
git clone <your-repo-url>
cd code-editor- Install dependencies:
npm install- Start the development server:
npm run dev- Open your browser and navigate to
http://localhost:3000
- Select a Language Tab: Choose between HTML, CSS, or JavaScript tabs at the top of the editor
- Write Code: Use the Monaco editor with full IntelliSense support
- Live Preview: See your changes instantly in the preview panel on the right
- Save Code: Click the "Save" button or wait for auto-save (every 30 seconds)
- Run Code: Click "Run" to refresh the preview with your latest changes
- Reset: Click "Reset" to clear all code and start fresh
- Full VS Code editor experience in the browser
- Syntax highlighting for HTML, CSS, and JavaScript
- IntelliSense and auto-completion
- Code formatting on paste and type
- Bracket pair colorization
- Minimap for quick navigation
- Sandboxed iframe for safe code execution
- Real-time rendering of HTML, CSS, and JavaScript
- Error handling to prevent preview crashes
- Console error capture and logging
- Automatic saving to browser's localStorage
- Code persists across browser sessions
- Manual save option with visual feedback
- Last saved timestamp display
code-editor/
├── app.vue # Main app component
├── components/
│ ├── CodeEditor.vue # Main editor interface
│ ├── MonacoEditor.vue # Monaco editor wrapper
│ ├── Preview.vue # Live preview component
│ ├── IconHtml.vue # HTML tab icon
│ ├── IconCss.vue # CSS tab icon
│ └── IconJs.vue # JavaScript tab icon
├── assets/
│ └── css/
│ └── main.css # Global styles and Tailwind
├── public/ # Static assets
├── nuxt.config.ts # Nuxt configuration
├── tailwind.config.js # Tailwind configuration
└── package.json # Project dependencies
# Start development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview
# Generate static site
npm run generateEdit tailwind.config.js to customize colors and theme:
theme: {
extend: {
colors: {
// Add your custom colors
}
}
}Edit MonacoEditor.vue to customize editor options:
monaco.editor.create(editorContainer.value, {
fontSize: 14,
theme: 'vs-dark',
// Add more options
})Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.
- Monaco Editor - Microsoft's amazing code editor
- Nuxt 3 - For the excellent Vue framework
- Tailwind CSS - For the utility-first CSS framework
For questions or feedback, please open an issue on GitHub.
Made with ❤️ using Nuxt 3, Tailwind CSS, and Monaco Editor