Version: 5.x
vm-icon-library
This component was inspired by Shoelace.
Loads and renders an SVG icon. The icon be loaded from an icon library or from
an absolute URL via the src
property. Only SVGs on a local or CORS-enabled endpoint are
supported. If you're using more than one custom icon, it might make sense to register a custom
icon library.
#
Usage- HTML
- React
- Vue
- Svelte
- Stencil
- Angular
example.vue
example.svelte
example.html
example.ts
#
PropertiesProperty | Description | Type | Default |
---|---|---|---|
name | The name of the icon library to register. Vime provides some default libraries out of the box such as vime or material . | string ∣ undefined | undefined |
resolver | A function that translates an icon name to a URL where the corresponding SVG file exists. The URL can be local or a CORS-enabled endpoint. | ((name: string) => string) ∣ undefined | undefined |