npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue3-icon-svg

v0.0.7

Published

A Vue 3 web component for rendering SVG icons. This package allows you to easily use SVG icons in your Vue applications. The component dynamically loads SVG icons based on the provided icon name and renders them in the Shadow DOM.

Downloads

8

Readme

Vue SVG Icons

A Vue 3 web component for rendering SVG icons. This package allows you to easily use SVG icons in your Vue applications. The component dynamically loads SVG icons based on the provided icon name and renders them in the Shadow DOM.

Installation

First, install the package via npm:

npm install vue3-svg-icons --save

Usage

Define the custom element in your main JavaScript or TypeScript file:

import { defineIconSvg } from "vue3-svg-icons";

defineIconSvg();

Then, use the custom element in your Vue components:

<template>
  <div>
    <icon-svg icon-name="home" width="48px" height="48px"></icon-svg>
  </div>
</template>

Or if you want to use your own tagName, you can define it like this:

import { defineIconSvg } from "vue3-svg-icons";

defineIconSvg("my-icon-tag");

Then, use the custom element with your own tagName in your Vue components:

<template>
  <div>
    <my-icon-tag icon-name="home" width="48px" height="48px"></my-icon-tag>
  </div>
</template>

Props

  • iconName (required): The name of the icon to be displayed. This should correspond to the SVG file name without the .svg extension.
  • width (optional): The width of the icon. Default is 24px.
  • height (optional): The height of the icon. Default is 24px.

Using Custom Icons

You can also use your own icons by adding them to the @/assets/icons directory in your project. Ensure the SVG files are named appropriately, and you can reference them just like the built-in icons.

For example, if you add an SVG file named custom-icon.svg to @/assets/icons, you can use it as follows:

<template>
  <div>
    <icon-svg icon-name="custom-icon" width="32px" height="32px"></icon-svg>
  </div>
</template>

Icons List

The following icons are available in this package:

  • arr
  • arr-l
  • burger
  • cashier
  • checkBox
  • close
  • close-bold
  • coins
  • eye
  • eye-off
  • filter
  • flag_de-DE
  • flag_en-US
  • flag_es-ES
  • flag_fr-FR
  • flag_hi-IN
  • flag_hu-HU
  • game
  • grid2
  • home
  • login
  • logout
  • mail
  • play
  • plus
  • promotion
  • restart
  • search
  • select
  • social_facebook
  • social_instagram
  • social_x
  • star
  • star-stroke
  • support
  • timer
  • user
  • vip
  • wallet

Example

Here is an example of how to use different icons with the IconSvg component:

<template>
  <div>
    <icon-svg icon-name="search" width="32px" height="32px"></icon-svg>
    <icon-svg icon-name="user" width="48px" height="48px"></icon-svg>
    <icon-svg icon-name="logout" width="24px" height="24px"></icon-svg>
  </div>
</template>