Welcome to Android SVG Support extension! This guide will help you get started quickly.
- Open VS Code
- Press
Ctrl+Shift+X(orCmd+Shift+Xon Mac) to open Extensions - Search for "Android SVG Support"
- Click Install
- Reload VS Code if prompted
The extension comes with sample files in the sample/drawable/ directory. You can use these to test all features:
- Open any of the sample files:
sample/drawable/ic_favorite.xml- Heart icon with tintsample/drawable/ic_home.xml- Home iconsample/drawable/ic_star.xml- Star with multiple pathssample/drawable/ic_check_circle.xml- Check mark icon
Use any of these methods:
- Click the preview icon (📄) in the editor title bar
- Press
Ctrl+Shift+V(orCmd+Shift+Von Mac) - Right-click and select "Show Vector Drawable Preview"
- Open Command Palette and type "Show Vector Drawable Preview"
- Zoom In: Click
+button or press+key - Zoom Out: Click
-button or press-key - Fit to View: Click "Fit to View" button or press
0key - Mouse Zoom: Hold
Ctrl/Cmdand scroll mouse wheel
- Hover over the
<vector>tag to see the complete preview - Hover over any
<path>tag to see that specific path - Tooltips show colors and dimensions
- Try changing the
android:fillColorvalue - Watch the preview update in real-time!
- Open your Android project in VS Code
- Navigate to
res/drawable/directory - Open any XML file with a
<vector>element - Use the preview features described above
| Action | Windows/Linux | Mac |
|---|---|---|
| Open Preview | Ctrl+Shift+V |
Cmd+Shift+V |
| Zoom In | + or = |
+ or = |
| Zoom Out | - or _ |
- or _ |
| Fit to View | 0 |
0 |
| Mouse Zoom | Ctrl + Wheel |
Cmd + Wheel |
- Keep preview open while editing - The preview updates automatically
- Use hover tooltips - Quick way to inspect individual paths
- Use zoom controls - Better visibility for complex drawables
- Preview not showing? - Make sure the file contains a
<vector>tag - Colors look wrong? - Color references (
@color/...) use default colors - Preview not updating? - Save the file to trigger an update
The extension includes these sample files for testing:
- Demonstrates: Basic path, tint attribute
- Color: Red (#FF0000)
- Demonstrates: Basic path with custom color
- Color: Blue (#2196F3)
- Demonstrates: Multiple paths, fill alpha
- Colors: Amber (#FFC107) with overlay
- Demonstrates: Complex path
- Color: Green (#4CAF50)
- Read the full README for detailed documentation
- Check CHANGELOG for version history
- Try creating your own vector drawables!
- Check the README for detailed feature descriptions
- Visit the GitHub repository for issues and discussions
- Submit feature requests or bug reports
Happy coding! 🎨