@dzangolab/vue-country-flag-icon

A vue.js component to display country flag icons.
15,189 3
Install
npm install @dzangolab/vue-country-flag-icon
Latest Version:0.3.0
Vue:3
Older releases:2
License:MIT
Last Updated:Mar 13, 2024
Links: GitHub  ·  npm
Maintainer: opichon

@dzangolab/vue-country-flag-icon

Country flag component for Vue. Supports SSR apps.

Requirements

  • vue.js >= 3.0

Usage

Add the package to your app via npm:

npm install @dzangolab/vue-country-flag-icon --save

or yarn:

yarn add @dzangolab/vue-country-flag-icon

Add CountryFlag globally

# main.js

import CountryFlag from '@dzangolab/vue-country-flag-icon'
import '@dzangolab/vue-country-flag-icon/dist/CountryFlag.css' // import stylesheet

app.use('CountryFlag', CountryFlag)

Add CountryFlag inside a component

# MyComponent.vue
<template>
  <CountryFlag iso="GB" mode="squared" />
  <CountryFlag iso="GB" mode="rounded" />
</template>

<script>
  import CountryFlag from '@dzangolab/vue-country-flag-icon'
  import '@dzangolab/vue-country-flag-icon/dist/CountryFlag.css' // import stylesheet

  export default {
    components: {
      CountryFlag
    }
  }
</script>

Props

iso

country ISO code (alpha-2 code).

This setting is required.

title

title for the country flag.

mode

Determines the behavior of the country flag. This component support 2 modes rounded and squared.

This setting is required.

SCSS

Instead of importing the css file in component or main.js, you can also import scss file into your app scss file.

@import '~@dzangolab/vue-country-flag-icon/src/assets/scss/country-flag.scss';

Related Packages

vue3-country-flag-icon

A vue 3 component to display country flag icons.

4,986 0
vue-country-flag-next

Simple Vue component for displaying of country flags

1,772,033 180
vue-country-flag

Simple Vue component for displaying of country flags

493,603 180
gfr-vue-country-flag

Simple Vue component for displaying of country flags

1,019 180
vue-circle-flags

A vue component with a collection of 400+ circular SVG country flags. Wrapper of...

145,581 6

Version History

Version Released License
0.3.0 MIT
0.2.0 MIT
0.1.5 MIT
0.1.4 MIT
0.1.3 MIT