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

vue-flag-icon

v2.1.0

Published

vue flag icon component

Downloads

29,345

Readme

Vue-Flag-Icon

NPM

a Vue2 Compoment for flag-icon

Install

npm i --save vue-flag-icon

Usage

Just declare the global Compoment with the use directive in your app

import FlagIcon from 'vue-flag-icon'
Vue.use(FlagIcon);

Then to use it

<template>
<div>
...

<flag iso="it" />
<flag iso="gb" />
<flag iso="us" />

...
</div>
</template

To see a full set of all the icons and countries iso codes visit the flag-icon-css website. There are 246 different icons there.

Being svg files they are resizable as long as you set the font size accordingly in a wrapper element

<div style="font-size:180px">
    <flag iso="it" />
</div>

The property iso can be as well dynamically set from an object

let guy = {
    name: "Vincenzo",
    nationality: "it"
}

in the Compoment you should dynamically bind the value

<flag :iso="guy.nationality" />

Screenshot

Code Example

(it is the basic vue-cli webpack template)

<template>
  <div id="app">
    <img src="./assets/logo.png">
    <hello></hello>
    <flag iso="it" />
    <flag iso="gb" />
    <flag iso="us" />
  </div>
</template>

<script>
import Hello from './components/Hello'

export default {
  name: 'app',
  components: {
    Hello
  }
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>

Additional Props

From 1.0.4 you can now specify two different properties:

  • squared : it will render the flag as a square if true, otherwise the flag will be rectangular shaped (true by default).
  • title : you can specify the title of the flag icon, (by default it will be overwritten by the iso)

Result

image