@markrabey/react-native-flags
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

React Native Flags npm (scoped)

A React Native component to display country flags with the ISO 3166-1 alpha 2 Standard.

Table of Contents:

Installation

yarn add @markrabey/react-native-flags

Usage

import {View} from 'react-native';
import Flag from '@markrabey/react-native-flags';

function App() {
  return (
    <View>
      <Flag countryCode="CA" />
      <Flag countryCode="CA" variant="flat" />
      <Flag countryCode="CA" size="14" />
    </View>
  );
}

Props

Prop Required Options Default
countryCode Yes ISO-3166-1 alpha-2 Country Code
variant No emoji , flat - see Variants for details emoji
size No number 14

Variants

Variants offer different styles of flags.

emoji - displays the standard flag emoji. The appearance the flags depends on the operating system's use of emojis.

flat - displays a .png of the flag with a flat style

Future Versions

React Native Flags is in active development with new features planned or being considered:

  • Additional variants, including a 3d style
  • Color variants - currently planning to offer color or black and white
  • Replace .png files with .svg for better scaling and smaller package size
  • New flags to be added:
    • LGBT
    • Canadian Provinces
    • US States
    • Unofficial or dissolved countries
    • Fantasy worlds (Star Wars, LOTR, etc.)

License

MIT license @ Mark Rabey

Dependencies (0)

    Dev Dependencies (5)

    Package Sidebar

    Install

    npm i @markrabey/react-native-flags

    Weekly Downloads

    21

    Version

    0.0.1

    License

    MIT

    Unpacked Size

    11.4 MB

    Total Files

    547

    Last publish

    Collaborators

    • markrabey