Compose Viewer is a real-time Jetpack Compose Desktop code editor and previewer. Write Kotlin Compose UI code and see the results instantly - perfect for prototyping, learning, and experimenting with Compose Multiplatform.
- Live Preview: Instant compilation and preview as you type
- External Compatibility:
- Dynamic Auto-Mocking: Automatically handles external types (e.g.
ChuckerTheme) and Android APIs (stringResource,R.string) for easy copy-pasting from existing projects. - Smart Entry-Point: Prioritizes no-argument
@Composablefunctions (Previews) as targets.
- Dynamic Auto-Mocking: Automatically handles external types (e.g.
- File Management:
- Save as .kt: Persistent save icon and
Cmd+Skeyboard shortcut. - Import .kt: Quickly open existing Compose files with
Cmd+O.
- Save as .kt: Persistent save icon and
- Advanced Editor:
- Intelligent Autocomplete: Prefilled snippets for common components (
Text,Button, etc.) with smart cursor placement. - Syntax highlighting for Kotlin/Compose
- Auto-indentation and bracket matching
- Search & Replace (Cmd+F / Ctrl+F)
- Line numbers
- Intelligent Autocomplete: Prefilled snippets for common components (
- Code Samples Library: 11 ready-to-use examples across 4 categories
- Basics: Hello World, Button Click
- Layouts: Card Layout, LazyColumn List
- Animation: Animated Counter, Kinetic Radar, Quantum Wave Field
- Graphics: Color Gradient
- Advanced: Network Image, Progress Indicators, Live Stock Market
- Code Formatting: Integrated ktfmt for clean code
- Cross-Platform: Native support for macOS, Windows, and Linux
- Network Images: Coil integration for
AsyncImagesupport - Helper Utilities: Built-in
maxWidth,maxHeightvariables
- Professional dark theme (IntelliJ-inspired)
- Resizable split view
- Version display and update checker
- Platform-specific keyboard shortcuts
- JDK 17 or higher
git clone https://github.com/ranjeetchouhan/compose-code-viewer.git
cd compose-code-viewer
gradlew.bat rungit clone https://github.com/ranjeetchouhan/compose-code-viewer.git
cd compose-code-viewer
./gradlew run- Browse Samples: Click the 📚 Samples button to explore pre-built examples
- Write Code: Type your Compose UI code in the left editor
- Run: Click the
▶️ Run button to compile and preview - Save/Import: Use the 💾 and 📂 icons (or
Cmd+S/Cmd+O) to manage your files - Format: Click the </> icon to auto-format your code
- Reload: Click 🔄 to refresh the preview
- Search: Press
Cmd+F(Mac) orCtrl+F(Windows)
- Search:
Cmd+F(Mac) /Ctrl+F(Windows) - Save:
Cmd+S(Mac) /Ctrl+S(Windows) - Import:
Cmd+O(Mac) /Ctrl+O(Windows) - Next Match:
Enter - Previous Match:
Shift+Enter - Navigate Search:
Arrow Up/Down
We're constantly working to make Compose Viewer better. Here's what's on our horizon:
- More Samples: New Material 3 components and advanced animation examples.
- Export Tools: Save your previews as high-quality images.
- Visual Themes: Toggle between Dark and Light modes.
- Project Support: Working with multiple files and folders.
- Mobile Preview: Live preview for Android and iOS devices.
We welcome contributions! Here's how you can help:
- ⭐ Star this repository if you find it useful
- 🐛 Report issues for bugs or feature requests
- 🔧 Submit pull requests to improve the code
- 📖 Help improve documentation
- 💡 Suggest new features or samples
⭐ Star this repository if you find it useful!
🐛 Report issues for bugs or feature requests
This project is licensed under the MIT License - see the LICENSE file for details. You are free to use, modify, and distribute this software.
