react-native-flags-kit

1.0.1 • Public • Published

react-native-flags-kit

Installation

$ npm install react-native-flags-kit --save

Usage

import Flag from 'react-native-flags-kit';
 
<Flag
  code="DE"
  size={32}
/>

Full usage code

import React, {Component} from 'react';
import {
  Platform,
  StyleSheet,
  View,
} from 'react-native';
 
import Flag from 'react-native-flags-kit';
 
type Props = {};
export default class App extends Component<Props> {
  render() {
    return (
      <View style={styles.container}>
        <Flag
          code="KH"
          size={16}
        />
        <Flag
          code="US"
          size={32}
        />
        <Flag
          code="MY"
          size={32}
        />
      </View>
    );
  }
}
 
const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
    fontSize: 30,
  },
});

Props

Props Type Default Description
code string The ISO code of a flag, for example "KH", "US" or "GB".
type string (flat or shiny) shiny Display the flags shiny or flat.
size number (16, 24, 32, 48 or 64) 64 The size of a flag in points.
style (optional) Allows additional styles to be passed through.

Wrap Up

If you think any of the react-native-flags-kit can be improved, please do open a PR with any updates and submit any issues. Also, I will continue to improve this, so you might want to watch/star this repository to revisit.

Contribution

We'd love to have your helping hand on contributions to react-native-flags-kit by forking and sending a pull request!

Your contributions are heartily ♡ welcome, recognized and appreciated. (✿◠‿◠)

How to contribute:

  • Open pull request with improvements
  • Discuss ideas in issues
  • Spread the word
  • Reach out with any feedback

License

The MIT License License: MIT

Package Sidebar

Install

npm i react-native-flags-kit

Weekly Downloads

223

Version

1.0.1

License

MIT

Unpacked Size

2.49 MB

Total Files

2619

Last publish

Collaborators

  • bunlong