A tree-shakable React library for displaying world flags as SVG components.
- Tree-shaking support – Only import the flags you need
- Optimized for performance – No unnecessary dependencies
- Easy to use – Simple React components
- SVG-based – High-quality, scalable flags
npm install @venediktoff/react-flagsor with Yarn:
yarn add @venediktoff/react-flagsImport only the flags you need:
import React from 'react';
import { FlagUS } from '@venediktoff/react-flags';
const App = () => (
<div>
<FlagUS />
</div>
);
export default App;git clone https://github.com/venediktoff/react-flags.git
cd react-flagsnpm installEach flag is exported individually to allow tree-shaking, meaning only the imported flags are included in the final bundle.
Flags are named using their ISO 3166-1 alpha-2 country codes. Example:
import { FlagUS } from '@venediktoff/react-flags';For a full list of supported flags, check the flags directory.
MIT License. See LICENSE for details.
Made with ❤️ by Ivan Venediktov