Skip to content

Latest commit

Β 

History

History
76 lines (49 loc) Β· 1.41 KB

File metadata and controls

76 lines (49 loc) Β· 1.41 KB

React Flags

A tree-shakable React library for displaying world flags as SVG components.

πŸš€ Features

  • 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

πŸ“¦ Installation

npm install @venediktoff/react-flags

or with Yarn:

yarn add @venediktoff/react-flags

πŸ“– Usage

Import only the flags you need:

import React from 'react';
import { FlagUS } from '@venediktoff/react-flags';

const App = () => (
  <div>
    <FlagUS />
  </div>
);

export default App;

πŸ›  Setup & Development

1. Clone the Repository

git clone https://github.com/venediktoff/react-flags.git
cd react-flags

2. Install Dependencies

npm install

πŸ—οΈ How It Works

Each flag is exported individually to allow tree-shaking, meaning only the imported flags are included in the final bundle.

πŸ“œ Available Flags

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.

πŸ“„ License

MIT License. See LICENSE for details.


Made with ❀️ by Ivan Venediktov