react-native-svg-flagkit provides 250 flags to easily use in react-native.
Assets are all from FlagKit.
Inspired from FlagKit & react-native-svg & svgr.
npm install react-native-svg-flagkit
react-native-svg-flagkit depends on react-native-svg.
react-native link react-native-svg
import { Flag } from 'react-native-svg-flagkit'
export default class App extends Component {
render() {
return (
<View>
<Flag
id={'TW'}
/>
<Flag
id={'US'}
size={0.2}
/>
<Flag
id={'JP'}
width={100}
height={100}
/>
</View>
);
}
}
Prop | Type | Default | Note |
---|---|---|---|
size |
number |
1 | scale from default with, height |
width |
number |
210 | SVG or Image width |
height |
number |
150 | SVG or Image width |
onPress |
function |
Press flag event |
git clone [email protected]:jackmew/react-native-svg-flagkit.git
cd example
npm install
- Square Flag
- Circle Flag
Due to there is a react-native-svg Mask Component issue.
There are some svg component is not available currently.
When you use Flag component, it will automatically to use PNG to replace SVG.
The only problem is that when you try to scale PNG, it will be fuzzy.