Skip to content
This repository was archived by the owner on Mar 7, 2023. It is now read-only.

Latest commit

 

History

History
69 lines (51 loc) · 1.76 KB

File metadata and controls

69 lines (51 loc) · 1.76 KB

nxt-flags

GitHub license npm scope

Angular component to show country flags.

Demo

Docs

Install

Install the package with NPM:

$ npm install nxt-flags

Import the module to app.module.ts:

import { FlagsModule } from 'nxt-flags';

@NgModule({
    ...
    imports: [
        ...,
        FlagsModule,
        ...
    ],
    ...
})

Add this lines to angular.json:

{
    ...
    "assets": [
        ...,
        {
            "glob": "**/*",
            "input": "./node_modules/nxt-flags/assets/flags",
            "output": "./assets/flags"
        }
    ].
    ...
}

Usage

Use the tag nxt-flag with attribute country="xx" (where xx is the ISO 3166-1-alpha-2 code of a country):

<nxt-flag country="br"></nxt-flag>

Optional attributes

attribute options default description
size 'xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl', 48 sets the flag width
format 'none', 'round', 'square' 'none' sets the flag format