A VS Code extension that provides intelligent autocomplete for SVG icon references in <use href=""> attributes.
- Smart Autocomplete: Triggers automatically when typing
#inside ahrefattribute of a<use>element - SVG Symbol Detection: Automatically scans your SVG sprite file and extracts all
<symbol>IDs - Configurable Path: Customize the icon file path per project
- Performance: Caches icon IDs for fast autocomplete
Type # after /icons/icons.svg in any <use href=""> attribute:
<svg class="icon">
<use href="/icons/icons.svg#" />
</svg>
The extension automatically enables quick suggestions in HTML, CSHTML, Vue, Svelte and React files. When you type # after the SVG path, autocomplete will automatically appear with available icon IDs from your SVG sprite file.
You can also manually trigger autocomplete at any time:
- macOS:
Option + EscorCmd + I - Windows/Linux:
Ctrl + Space
The extension automatically detects your project configuration:
- Nuxt projects: Automatically finds
nuxt.config.*and looks for icons at[project-root]/public/icons/icons.svg - Vite projects with custom root: Reads the
rootoption fromvite.config.*and looks for icons at[vite-root]/public/icons/icons.svg - Standard projects: Falls back to
public/icons/icons.svgfrom workspace root
Important: The extension always looks for icons at /public/icons/icons.svg relative to your project or Vite root. The path you use in your href attribute is ignored - the extension automatically determines the correct file location based on your build configuration.
You can manually configure the path to your SVG icon file in VS Code settings if needed:
- Open VS Code Settings (Cmd+, on macOS, Ctrl+, on Windows/Linux)
- Search for "IconComplete"
- Set "IconComplete: Icon File Path" to your custom path (relative to workspace root)
Or add to your .vscode/settings.json:
{
"iconComplete.iconFilePath": "path/to/your/icons.svg"
}Nuxt Project:
- Config:
nuxt.config.tsat project root - Icons location:
[project-root]/public/icons/icons.svg - In your code:
<use href="/icons/icons.svg#home" />
Vite Project with Custom Root:
// vite.config.mts
export default {
root: 'src'
}- Icons location:
[project-root]/src/public/icons/icons.svg - In your code:
<use href="/dist/icons/icons.svg#home" />(or any path)
The extension ignores the href path and uses the build configuration to find the actual icon file.
The extension:
- Monitors your cursor position in supported file types
- Detects when you type
#inside ahrefattribute - Automatically finds your Vite or Nuxt config file
- Determines the correct icon file location (
public/icons/icons.svgrelative to your project/build root) - Reads and parses your SVG sprite file
- Extracts all
<symbol id="...">attributes - Presents them as autocomplete suggestions
Note: The path you use in your href attribute (e.g., /icons/icons.svg or /dist/icons/icons.svg) doesn't affect where the extension looks for the icon file. It always uses your build configuration to find the actual file location.
To run the extension in development mode:
- Clone the repository
- Run
npm install - Press F5 to open a new VS Code window with the extension loaded
- Test the autocomplete in a file containing and
<svg><use href="/icons/icons.svg# /></svg>
npm run compileMIT