https://github.com/uiwebkit/flags
Uni Flags
https://github.com/uiwebkit/flags
country-flags custom-elements flag flags html stencil stenciljs web web-components webcomponents
Last synced: 9 months ago
JSON representation
Uni Flags
- Host: GitHub
- URL: https://github.com/uiwebkit/flags
- Owner: uiwebkit
- License: mit
- Created: 2021-11-13T08:37:52.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-12T21:18:09.000Z (about 4 years ago)
- Last Synced: 2025-06-10T14:18:07.179Z (10 months ago)
- Topics: country-flags, custom-elements, flag, flags, html, stencil, stenciljs, web, web-components, webcomponents
- Language: TypeScript
- Homepage: https://uiwebkit.com/icn/1/flag/?type=element
- Size: 1.28 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README

# Uni Flags
Uni Flags a set of Custom Elements to use Country flags icons in the declarative style.
Uni Flags takes TypeScript, JSX, a tiny virtual DOM layer, efficient one-way data binding, an asynchronous rendering pipeline (similar to React Fiber), and lazy-loading out of the box, and generates 100% standards-based Web Components & Custom Elements that run in any browser supporting the Custom Elements v1 spec.
Uni Flags components are just HTML Web Components & Custom Elements, so they work in any major framework or with no framework at all.
## Getting Started
To start building a new web component using Stencil, clone this repo to a new directory:
```bash
git clone https://github.com/uiwebkit/flags.git uni-flags
cd uni-flags
```
and run:
```bash
npm i
npm run serve:dev
```
To build the component for production, run:
```bash
npm run build:prod
```
Check out our docs [here](https://uiwebkit.com/icn/1/flag/?type=element).
## Naming Components
When creating new component tags, use `uni` in the component name (ex: ``) or use a prefix that fits your company or any name for a group of related components. For example, all the UiWebKit generated Web Components & Custom Elements use the prefix `uni`.
## Using Components
There are two strategies we recommend for using Uni Flags:
### Script tag
- Put a script tag `` in the head of your index.html
- To support old browsers, also put a script tag `` in the head of your index.html
- Then you can use the element anywhere in your template, JSX, html etc
### Node Modules
- Run `npm i @uiwebkit/flag --save`
- Put a script tag similar to this `` in the head of your index.html
- To support old browsers, also put a script tag `` in the head of your index.html
- Then you can use the element anywhere in your template, JSX, html etc