Material Icons Autocomplete for VS Code (v0.0.5)
A powerful Visual Studio Code extension that enhances Angular Material development by providing intelligent autocompletion and a visual picker for Material Design Icons within <mat-icon> tags. With over 2,500 icons, fast virtual scrolling, and seamless VS Code integration, this extension streamlines icon selection for Angular developers.
Features
- Intelligent Autocomplete: Suggests Material Icons as you type within
<mat-icon> tags in HTML, TypeScript, JavaScript, TSX, or JSX files.
- Visual Previews: Displays icon previews in the autocomplete dropdown, complete with category, tags, and usage examples.
- Categorized Icons: Organizes icons into categories (e.g., action, navigation, other) for intuitive browsing.
- Visual Icon Picker: A webview-based picker with search, category filters, and virtual scrolling for fast navigation of thousands of icons.
- Custom Icon Support: Add your own icons with custom names, categories, tags, and SVG content, saved to your workspace.
- Optimized Performance: Virtual scrolling and local caching ensure quick load times, even with a large icon set.
- Dark Mode Support: Adapts to VS Code's light and dark themes using native CSS variables.
- Robust Editor Integration: Inserts icons into the correct editor, preserving focus and preventing unintended tab creation.
Version
The version number corresponds to the extension's release, as defined in the package.json file. Check the Releases page for the latest updates and changelog.
Installation
Install from VS Code Marketplace (recommended):
- Open VS Code, go to the Extensions view (Ctrl+Shift+X or Cmd+Shift+X on Mac).
- Search for Material Icons Autocomplete.
- Click Install.
Usage
Autocomplete
Trigger autocomplete for Material Icons within <mat-icon> tags in supported files (HTML, TypeScript, JavaScript, TSX, JSX):
Open a file (e.g., app.component.html).
Type <mat-icon> and place the cursor inside the tag:
<mat-icon><!-- Cursor here --></mat-icon>
Start typing an icon name (e.g., home) to see suggestions.
Select an icon from the dropdown to insert it:
<mat-icon>home</mat-icon>
Hover over a suggestion to view a preview, category, tags, and usage example.
Icon Picker
Access the full icon set via a visual picker:
- Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P).
- Run
Material Icons: Show Icon Picker .
- Use the search bar to find icons by name or tags (e.g., search, navigation).
- Filter by category using the dropdown (e.g., action, other).
- Click an icon to insert it into the active editor:
<mat-icon>favorite</mat-icon>
Save Custom Icons
Add your own icons to the autocomplete and picker:
Open the Command Palette and run Material Icons: Save Custom Icon .
Enter:
- Icon Name: The unique name for your icon (e.g., custom_star).
- Category: A category (e.g., action, or other).
- Tags: Comma-separated tags for searching (e.g., star, favorite).
- SVG Content: Optional SVG code for the icon's appearance.
The icon is saved to material-icons.json in your workspace root and becomes available immediately.
Configuration
Customize the extension via VS Code settings:
Custom Icons Path:
Specify a path to a custom material-icons.json file:
{
"materialIcons.customIconsPath": "/path/to/your/material-icons.json"
}
The file should follow this format:
[
{
"name": "custom_icon",
"category": "custom",
"tags": ["custom", "example"],
"description": "A custom icon",
"svgContent": "<svg>...</svg>"
}
]
Requirements
- VS Code: Version 1.85.0 or higher.
- Node.js: Version 16.x or higher (for development/build).
- Internet Connection: Required for initial icon fetching; cached locally thereafter.
- File Types: Works in HTML, TypeScript, JavaScript, TSX, and JSX files.
- Angular Material: Recommended for
<mat-icon> usage, but not required.
- Virtual Scrolling: The icon picker renders only visible icons, reducing load times to under 1 second for 2,500+ icons.
- Caching: Icons are cached in resources/material-icons-cache.json, with up to 50 SVGs stored locally for fast previews.
- Efficient Filtering: Search and category filters update instantly, even with large datasets.
Troubleshooting
Contributing
- Fork the repository: github.com/your-username/material-icons-autocomplete.
- Create a feature branch:
git checkout -b feature/your-feature
- Commit changes:
git commit -m "Add your feature"
- Push to the branch:
git push origin feature/your-feature
- Open a Pull Request with a clear description and tests.
Please update the README and include tests for new features.
License
MIT License - see the LICENSE file for details.
Acknowledgments
- Google Material Design Icons for the extensive icon library.
- Angular Material for
<mat-icon> component inspiration.
- VS Code Extension API for enabling robust extension development.
Manual Installation:
Clone the repository:
git clone https://github.com/your-username/material-icons-autocomplete.git
cd material-icons-autocomplete
Install dependencies:
npm install
Compile the extension:
npm run compile
Package the extension (if needed):
npm run package
Install the .vsix file via VS Code's Install from VSIX option in the Extensions view.
Development Setup:
- Open the project in VS Code.
- Press F5 to launch the extension in an Extension Development Host window.
File issues or feature requests on the GitHub repository. For direct inquiries, reach out to [emkmohan007@gmail.com].
Built with ❤️ by MOHANKUMAR E (iamEMK)
Last updated: May 15, 2025
| |