Skip to content

LL19991220/codeshot

Repository files navigation

🎨 CodeShot

Beautiful code screenshots in seconds.

A free, open-source alternative to shots.so β€” create stunning code images for social media, blog posts, and presentations.

License: MIT Deploy with Vercel

πŸ”— Live Demo: https://codeshot-lovat.vercel.app

Other Languages: δΈ­ζ–‡ | ν•œκ΅­μ–΄ | ζ—₯本θͺž

✨ Features

  • 🎯 Real-time Preview β€” See changes instantly as you type
  • 🎨 12+ Code Themes β€” GitHub Dark, Dracula, One Dark Pro, Nord, and more
  • 🌈 Gradient Backgrounds β€” Beautiful preset gradients or custom colors
  • πŸͺŸ Window Styles β€” macOS, Windows, Minimal, and Rounded frames
  • πŸ“ Customizable β€” Padding, line numbers, title, and more
  • πŸ“‹ Copy to Clipboard β€” One-click copy for quick sharing
  • πŸ“₯ Export PNG/SVG β€” High-resolution exports for any use case
  • πŸš€ Pure Frontend β€” No server, no tracking, runs entirely in your browser

πŸš€ Quick Start

# Clone the repo
git clone https://github.com/yourusername/codeshot.git
cd codeshot

# Install dependencies
npm install

# Start development server
npm run dev

Open http://localhost:5173 and start creating!

πŸ› οΈ Tech Stack

  • Framework: React 18 + TypeScript
  • Build Tool: Vite
  • Styling: Tailwind CSS
  • Syntax Highlighting: Shiki (200+ themes, 100+ languages)
  • Image Export: html-to-image

πŸ“– Usage

  1. Paste your code in the left editor panel
  2. Choose a theme from the dropdown (GitHub Dark, Dracula, etc.)
  3. Pick a background gradient or solid color
  4. Select a window style (macOS dots, Windows, Minimal, etc.)
  5. Adjust padding and toggle line numbers
  6. Export as PNG/SVG or copy to clipboard

🎨 Available Themes

Dark Themes Light Themes
GitHub Dark GitHub Light
Dracula Solarized Light
One Dark Pro Vitesse Light
Nord
Monokai
Tokyo Night
Slack Dark

πŸ“ Project Structure

codeshot/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ Editor.tsx         # Code input editor
β”‚   β”‚   β”œβ”€β”€ Preview.tsx        # Real-time preview panel
β”‚   β”‚   β”œβ”€β”€ Toolbar.tsx        # Customization controls
β”‚   β”‚   └── ExportButton.tsx   # Export/copy buttons
β”‚   β”œβ”€β”€ themes/
β”‚   β”‚   └── index.ts           # Theme definitions
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   └── export.ts          # Export utilities
β”‚   β”œβ”€β”€ types/
β”‚   β”‚   └── index.ts           # TypeScript types
β”‚   β”œβ”€β”€ App.tsx                # Main application
β”‚   └── main.tsx               # Entry point
β”œβ”€β”€ index.html
└── package.json

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments


Made with ❀️ by developers, for developers.

About

🎨 Beautiful code screenshots in seconds - open source alternative to shots.so

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors