0.0.36 • Published 2 months ago
astro-cached-icon v0.0.36
astro-cached-icon
This package is still in beta, don't use in production Effortlessly integrate Iconify icons into your Astro projects with caching and bundling for optimal performance.
Features
- Seamless integration with Astro: Works effortlessly within Astro's component model.
- Iconify compatibility: Leverages the vast collection of icons from Iconify.
- Caching and bundling: Optimizes loading times by caching icons and bundling them into your Astro project.
- Existence check: Ensures icons are available before rendering, preventing errors.
- TypeScript support: Provides type safety and enhanced code completion.
- Flexible usage: Supports both
name
andpack
props or a combinedicon
prop for convenient icon selection. - Customizable SVG attributes: Allows for fine-grained control over SVG attributes.
Motive
this package is heavily inspired by
- astro-icon
- astro-preload and is basically created to fix their shortcomings
Installation
npm install astro-cached-icon
just import and use
import Icon from 'astro-cached-icon';
Usage
<Icon name="home" pack="mdi" />
or the shorthand
this is preferred
<Icon icon="mdi:home" />
it also takes normal SVG attributes
<Icon name="home" pack="mdi" width="24" height="24" class="icon-custom" style="color: red;" />
recommendations
use Iconify Intellisence VSCode extention if working with vscode to get preview and completion.
Additional notes
- Refer to the Iconify documentation for available icon packs and names: https://iconify.design/
- For more advanced usage and configuration options, check out the package's GitHub repository.
Contributing
Contributions are welcome! Please refer to the contribution guidelines in the GitHub repository.
npm
0.0.35
2 months ago
0.0.36
2 months ago
0.0.30
3 months ago
0.0.31
3 months ago
0.0.32
3 months ago
0.0.21
3 months ago
0.0.33
3 months ago
0.0.34
3 months ago
0.0.26
3 months ago
0.0.27
3 months ago
0.0.28
3 months ago
0.0.29
3 months ago
0.0.7
5 months ago
0.0.6
5 months ago
0.0.5
5 months ago
0.0.4
5 months ago
0.0.3
5 months ago
0.0.2
5 months ago
0.0.1
5 months ago