0.1.4 • Published 4 years ago

country-flags-react v0.1.4

Weekly downloads
156
License
MIT
Repository
github
Last release
4 years ago

country-flags-react

Demo Link

  • 1:1 aspect ratio flags
  • Zero custom webpack config
  • Lazily loads only the icons you need (via dynamic import())
  • TypeScript definitions

Usage

import { Flag } from "country-flags-react";

const MyApp = () => <Flag countryCode="US" size={48} />;
Prop NameTypeDescription
countryCodestringISO 3166-1-alpha-2 country code
sizenumberDimensions of flag, in pixels
fallbackReact.ReactNodeComponent rendered when no valid country provided

Distribution

The output bundle is ES5 code with CommonJS require() syntax and dynamic import() syntax for loading flags.

Prior Art

Flags used in this project are sourced from https://github.com/lipis/flag-icon-css.


0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago