An open API service indexing awesome lists of open source software.

https://github.com/captaincodeman/flag-icon-element

Flag-Icon CustomElement
https://github.com/captaincodeman/flag-icon-element

Last synced: 11 months ago
JSON representation

Flag-Icon CustomElement

Awesome Lists containing this project

README

          

# Flag-Icon Element

Custom-Element version of [flag-icon-css](https://github.com/lipis/flag-icon-css).

[Demo](https://captaincodeman.github.io/flag-icon-element/)

## Benefits

Approximately 300 bytes when bundled and compressed.
Flag images are loaded from the cloudflare CDN by default.
Shadow-Dom / WebComponent Friendly.

## Usage

Set country code as attribute of element to display the corresponding
flag. Use css font size to set the height.

```html

```

Icons will be loaded from the default path which can be overridden by
setting the path attribute ( `https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.1.0/flags`)

Default flag layout is 4:3. Set `square` attribute for square icons.

## Installation

Install from npm:

npm install --save @captaincodeman/flag-icon-element

Include in app using ...

### Typescript

import '@captaincodeman/flag-icon-element'

### ES Module

import '/node_modules/@captaincodeman/flag-icon-element/flag-icon.js'

### JavaScript Script Tag

or

### Node (CommonJS)

require('@captaincodeman/flag-icon-element')