A modern, lightweight code editor built with Next.js and TypeScript. Write, preview, and download HTML, CSS, and JavaScript code in real-time.
- 🎨 Real-time code preview
- 🌓 Dark/Light mode support
- 💾 Download code as HTML file
- ⚡ Fast and responsive
- 🎯 Monaco Editor integration
- 📱 Mobile-friendly design
-
Clone the repository:
git clone https://github.com/dcosodev/code-editor.git
-
Install dependencies:
npm install
-
Run the development server:
npm run dev
-
Open http://localhost:3000 in your browser.
- Framework: Next.js 15
- Language: TypeScript
- Styling: Tailwind CSS
- UI Components: shadcn/ui
- Code Editor: Monaco Editor
- Icons: Lucide Icons
├── app/ # Next.js app directory
├── components/ # React components
│ ├── editor/ # Editor-related components
│ └── ui/ # UI components
├── hooks/ # Custom React hooks
├── lib/ # Utility functions
└── public/ # Static assets
Editor
: Main editor component with HTML, CSS, and JS panelsEditorPanel
: Individual code editor panelPreview
: Live preview of the codeCodeEditor
: Monaco editor wrapper
Navbar
: Application header with theme toggleModeToggle
: Dark/light mode switcherButton
: Reusable button component
- Write HTML, CSS, and JavaScript code in their respective panels
- See real-time preview in the bottom panel
- Toggle between dark and light themes using the theme switcher
- Download your code as an HTML file using the download button
MIT License - feel free to use this code for your own projects!
Contributions are welcome! Please feel free to submit a Pull Request.