Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danalloway/react-country-flag
React component for emoji/svg country flags.
https://github.com/danalloway/react-country-flag
Last synced: 3 months ago
JSON representation
React component for emoji/svg country flags.
- Host: GitHub
- URL: https://github.com/danalloway/react-country-flag
- Owner: danalloway
- License: mit
- Created: 2017-08-03T18:48:37.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-05-05T09:20:20.000Z (7 months ago)
- Last Synced: 2024-07-29T16:32:39.372Z (5 months ago)
- Language: TypeScript
- Homepage: https://danalloway.github.io/react-country-flag/
- Size: 4.46 MB
- Stars: 245
- Watchers: 4
- Forks: 41
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-country-flag
> React component for emoji/svg country flags.
[![NPM](https://img.shields.io/npm/v/react-country-flag.svg)](https://www.npmjs.com/package/react-country-flag)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)## Install
```bash
npm install --save react-country-flag
```## BREAKING CHANGES
v3.x NONE
only Typescript Types were introduced, enjoy!v2.x has breaking changes
- `code` is now `countryCode`
- `title` and `aria-label` are not defined any more, it is up to the developer
to pass these in
- `styleProps` is now `style`## Usage
All props are passed onto the element, everything can be overwritten.
```jsx
import React from "react"
import ReactCountryFlag from "react-country-flag"function ExampleComponent {
return (
)
}export default ExampleComponent
```# Detecting Emoji support
Try this out and conditionally render your country flag
https://github.com/danalloway/detect-emoji-support## License
MIT © [danalloway](https://github.com/danalloway)