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
- Host: GitHub
- URL: https://github.com/captaincodeman/flag-icon-element
- Owner: CaptainCodeman
- Created: 2018-08-04T21:30:06.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T17:49:29.000Z (about 3 years ago)
- Last Synced: 2025-01-08T14:15:30.021Z (about 1 year ago)
- Language: HTML
- Size: 590 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: readme.md
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')