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 (a configured path always takes priority over auto-detection)
- Multiple Sprites: Merge symbols from several SVG files, de-duplicated by id. The picker groups icons under each file name, sorted alphabetically
- 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
If you configure an explicit path, it always takes priority. Otherwise the extension auto-detects the icon file:
- 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: When no path is configured, the path you use in your href attribute is ignored - the extension automatically determines the file location based on your build configuration.
Configure one or more SVG icon files in VS Code settings. A configured path always wins over auto-detection.
- Open VS Code Settings (Cmd+, on macOS, Ctrl+, on Windows/Linux)
- Search for "IconComplete"
- Set "IconComplete: Icon File Paths" to your custom path(s) (relative to workspace root)
Or add to your .vscode/settings.json:
{
"iconComplete.iconFilePaths": ["public/icons/fa-solid-used.svg", "public/icons/fa-regular-used.svg"]
}Icons from all listed files are merged. On duplicate ids, the first file wins.
The legacy single-path setting
iconComplete.iconFilePathis still supported but deprecated. PrefericonComplete.iconFilePaths.
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 - Uses your configured path(s) if set, otherwise finds your Vite or Nuxt config file to determine the default location (
public/icons/icons.svgrelative to your project/build root) - Reads and parses each SVG sprite file, merging symbols de-duplicated by id
- Extracts all
<symbol id="...">attributes - Presents them as autocomplete suggestions
Note: When no path is configured, 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 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