Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/benaubin/tiny-flag-react


https://github.com/benaubin/tiny-flag-react

Last synced: 17 days ago
JSON representation

Awesome Lists containing this project

README

        

# Tiny Flag React

Display country flags in less than 1KB with the magic of unicode (with graceful fallbacks).

Displays emoji by default, when not supported, falls back to an image tag.

[DEMO](https://codesandbox.io/s/country-flags-wz5g7?fontsize=14&hidenavigation=1&theme=dark)

## Install

```sh
npm i --save tiny-flag-react
yarn add tiny-flag-react
```

## Usage

```js
import TinyFlag from "tiny-flag";

;
```

[DEMO](https://codesandbox.io/s/country-flags-wz5g7?fontsize=14&hidenavigation=1&theme=dark)

## Recommended Fallback Images

Goes well with [FlagKit](https://github.com/madebybowtie/FlagKit.git) and Webpack's
[file-loader](https://webpack.js.org/loaders/file-loader/) for fallback images:

```sh
npm i --save https://github.com/madebybowtie/FlagKit.git
yarn add https://github.com/madebybowtie/FlagKit.git
```

```js
let country = "US";
let countryName = "United States";

```