A Visual Studio Code extension for live preview of Android Vector Drawable XML files, with zoom, pan, rulers, crosshair, and hover tooltips.
- Side-by-side preview that opens in a split view beside the editor
- Real-time updates as you edit (debounced 300ms)
- VS Code theme-integrated UI with checkerboard transparency background
- Auto-fit on open — scales the drawable to fill the panel
- Zoom toward pointer — Ctrl/Cmd + scroll zooms in on the cursor position
- Drag to pan — hold left mouse button and drag
- Keyboard shortcuts —
+/-to zoom,0to reset to fit - Floating zoom controls in the preview panel
- Zoom range: 25% – 5000%
- Pixel rulers along the top and left edges, updating as you scroll and zoom
- Toggle crosshair overlay with coordinate readout (coordinates in SVG space)
- Dashed border tracks the exact drawable boundary at any zoom level
- Dimension label shows width × height in pixels
- Hover over
<vector>to see a full drawable preview inline - Hover over
<path>to see that path's preview with fill/stroke color info
<path>withpathData,fillColor,strokeColor,fillAlpha,strokeAlpha,fillType<group>with full transform support:translateX/Y,rotation,pivotX/Y,scaleX/Yandroid:alphaon<vector>mapped to SVGopacity#AARRGGBBAndroid colors correctly converted torgba()android:fillType="evenOdd"mapped tofill-rule="evenodd"
| Method | Action |
|---|---|
| Editor title bar | Click the preview icon when a drawable XML is open |
| Context menu | Right-click → "Show Vector Drawable Preview" |
| Command Palette | Show Vector Drawable Preview |
| Keyboard shortcut | Ctrl+Shift+V / Cmd+Shift+V |
| Action | How |
|---|---|
| Zoom in | + or =, or click + button |
| Zoom out | - or _, or click - button |
| Fit to view | 0, or click fit button |
| Zoom toward pointer | Ctrl/Cmd + scroll wheel |
| Pan | Hold left mouse button and drag |
- VS Code 1.80.0 or higher
- Android vector drawable XML files (typically in
res/drawable/)
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<group
android:translateX="2"
android:rotation="45">
<path
android:fillColor="#FF000000"
android:pathData="M12,2L2,7v10c0,5.55,3.84,10.74,9,12c5.16,-1.26,9,-6.45,9,-12V7L12,2z"/>
</group>
</vector>- Color references (
@color/primary) render as default grey - Theme attributes (
?attr/colorPrimary) use default colors - Gradient fills not yet supported
- Animation not yet supported
- Fixed crosshair lines drifting with scroll and zoom
- Fixed crosshair SVG-space coordinate calculation
- Crosshair now shows sub-pixel coordinates at higher zoom levels
- Crosshair hides during drag and restores correctly on release
- Added extension icon
<group>element support with full transformandroid:alpha,android:fillTypesupport- Drag to pan
- Zoom toward pointer at all zoom levels
- Fixed
#AARRGGBBcolor conversion - Fixed bounds box tracking at all zoom levels
- Fixed ruler tick updates on scroll
- Fixed hover provider false positives between
<path>tags - Fixed race condition on preview button click
- Fixed double-dispose on panel close
- Debounced preview re-render to 300ms
- Fixed missing template files
- Initial release
MIT