Usage
The Meteor Icon Kit provides flexible ways to use icons in your application, whether you’re working with plain HTML, Vue, React, or other frameworks.Basic SVG Import
The most common way to use icons is by importing them as SVG modules:Framework Examples
Vue 3 with Vite
For Vue 3 projects using Vite, installvite-svg-loader to import SVGs as components:
React
For React projects, you can use SVGR or similar tools:Plain HTML
For plain HTML projects, you can inline the SVG or use an<img> tag:
Dynamic Colors
One of the key features of the Icon Kit is support for dynamic colors using CSS. This allows you to change icon colors based on context, state, or theme.Basic Color Styling
State-based Colors
Hover Effects
Icon Sizing
Control icon size using CSS:Common Use Cases
Icon Buttons
Navigation Icons
Status Indicators
Icon Path Structure
All icons follow a consistent import pattern:{style}is eitherregularorsolid{icon-name}is the kebab-case name of the icon
Examples
Best Practices
- Choose the Right Style: Use regular icons for subtle UI elements and solid icons for emphasis
- Consistent Sizing: Maintain consistent icon sizes within the same context
- Color Accessibility: Ensure sufficient contrast between icons and their backgrounds
- Semantic Usage: Use icons that clearly represent their function
- Performance: Import only the icons you need to optimize bundle size
Troubleshooting
Icons Not Displaying
If icons aren’t displaying, ensure:- CSS styles are imported
- SVG loader is configured for your bundler
- Import paths are correct
Colors Not Applying
If colors aren’t changing:- Verify
fill: currentColoris set in your CSS - Check that the parent element has the
colorproperty set - Ensure no inline
fillattributes override your CSS
Next Steps
- Icon Library - Browse all available icons
- Overview - Learn more about the Icon Kit