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

feather-icons-vue

v1.0.4

Published

Easy to use vue wrapper around feather icons, inheriting color and size from css cascade.

Downloads

16

Readme

feather-icons-vue

Easy to use vue wrapper around feather icons, inheriting color and size from css cascade. The whole deal about feather-icons-vue is that style context color and size are inherited.

<h1 class="blue-text">
  This is a big text with a big icon <icon-base name="arrow-right"></icon-base>
</h1>
<!-- Icon is big and has blue color by default because its within an h1 context with blue color. -->
<!-- Default css cascade/inheritance applies -->
<!--  -->
<!-- If you'd explicitly like to have a different colored/sized icon, you can specify icon style with css -->
<h1 class="blue-text">
  This is a big text with a big icon
  <icon-base name="arrow-right" class="red-text sm"></icon-base>
</h1>
<!--  -->
<!-- or with style instead of class -->
<h1 class="blue-text">
  This is a big text with a big icon
  <icon-base
    name="arrow-right"
    style="color: red; font-size: 0.5rem;"
  ></icon-base>
</h1>

I decided to make a new one because I like to think of elements (even icons) styling purely in terms of css, no need for passing in props to specify size or color.

Install

yarn add feather-icons-vue
# or
npm install feather-icons-vue

Usage

import IconBase from 'feather-icons-vue'

Vue.use(IconBase)
// you can also pass an option object with a custom name
Vue.use(IconBase, {
  as: 'MyIconSprites', // default is IconBase
})
// or in specific components

{
  components: {
    IconBase
  }
}

then do

<icon-base name="arrow-right" />
or

<IconBase name="arrow-left" />

or if you specified 'as' in options above, you can do

<my-icon-sprites name="arrow-right" />
or

<MyIconSprites name="arrow-left" />

Sizes

By default, icons will be sized based on the current element's font-size (or propagated parent font-size) Simply set the icon font-size as desired (either by adding css or styling directly)

feather-icons-vue ships with some default classes (for sizing), you can apply like so:

<!-- font-size: 0.5rem -->
<icon-base name="arrow-right" class="xs"></icon-base>
<!-- font-size: 0.7rem -->
<icon-base name="arrow-right" class="sm"></icon-base>
<!-- font-size: 1.5rem -->
<icon-base name="arrow-right" class="md"></icon-base>
<!-- font-size: 2rem -->
<icon-base name="arrow-right" class="lg"></icon-base>
<!-- font-size: 4rem -->
<icon-base name="arrow-right" class="xl"></icon-base>

Attributes work also (note this is not a prop, attribute will be attached to root svg element):

<!-- font-size: 0.5rem -->
<icon-base name="arrow-right" xs></icon-base>
<!-- font-size: 0.7rem -->
<icon-base name="arrow-right" sm></icon-base>
<!-- font-size: 1.5rem -->
<icon-base name="arrow-right" md></icon-base>
<!-- font-size: 2rem -->
<icon-base name="arrow-right" lg></icon-base>
<!-- font-size: 4rem -->
<icon-base name="arrow-right" xl></icon-base>

Colors

By default, icons will take the parent's color, you can explicitly specify icon color by simply adding a color class, like so:

<!-- font-size: 0.5rem -->
<icon-base name="arrow-right" class="blue-icon"></icon-base>

then define .blue-icon class

.blue-icon {
  color: blue;
}

Styles

You can style icons directly also, instead of classes or size attributes

<icon-base
  name="arrow-right"
  style="color: red; font-size: 0.5rem;"
></icon-base>

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

feather-icons-vue © damafeez, Released under the MIT License. Authored and maintained by damafeez with help from contributors (list).

GitHub @damafeez · Twitter @damafeez