A beautiful, modern code snippet sharing application built with React and Vite. Create stunning visual representations of your code with customizable themes and export them as high-quality images.
- Syntax Highlighting: Professional code highlighting with support for multiple programming languages
- Multiple Themes: Choose from various color schemes to match your style
- MacOS-Style Windows: Beautiful, authentic macOS window design for your code snippets
- Export to Image: Generate high-quality PNG/JPEG images of your code
- Auto Language Detection: Automatically detects the programming language from your code
- Responsive Design: Works seamlessly across desktop and mobile devices
- Real-time Preview: See changes instantly as you type
- React 19.1.0 - Modern React with latest features
- Vite 7.0.4 - Lightning-fast build tool and dev server
- React Syntax Highlighter - Professional code syntax highlighting
- html2canvas - High-quality code-to-image conversion
- PrismJS - Additional syntax highlighting support
- Node.js (version 16 or higher)
- npm or yarn
- Clone the repository:
git clone <repository-url>
cd code-share- Install dependencies:
npm install- Start the development server:
npm run dev- Open your browser and navigate to
http://localhost:5173
npm run dev- Start development server with hot reloadnpm run build- Build for productionnpm run preview- Preview production build locallynpm run lint- Run ESLint for code qualitynpm run deploy- Build and deploy to GitHub Pages
- Add Your Code: Paste or type your code in the editor
- Select Theme: Choose from available color themes
- Choose Language: Select the programming language (or let it auto-detect)
- Customize Export: Adjust export settings like format and quality
- Export: Click export to download your code as an image
src/
├── components/ # React components
│ ├── Header.jsx # App header with branding
│ ├── MacOSWindow.jsx # MacOS-style window wrapper
│ ├── CodeEditor.jsx # Code input and preview
│ └── Sidebar.jsx # Theme and settings panel
├── data/ # Static data and configurations
│ ├── sampleCode.js # Default code examples
│ ├── themes.js # Color theme definitions
│ └── languages.js # Language detection and support
├── hooks/ # Custom React hooks
├── utils/ # Utility functions
│ └── exportUtils.js # Image export functionality
├── themes/ # CSS theme files
└── assets/ # Static assets
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with React and Vite for optimal performance
- Syntax highlighting powered by React Syntax Highlighter
- Beautiful UI inspired by modern code editors and macOS design