npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@iseer/flags

v0.1.1

Published

React components for circular and rectangular country flags from Iseer CDN

Downloads

18

Readme

@iseer/flags

React components for circular and rectangular country flags

NPM License

A lightweight React component library for displaying country flags in two styles: circular and rectangular. All flags are served from Iseer's CDN for minimal bundle size.

📦 Installation

npm install @iseer/flags

🚀 Usage

Circular Flags

import { CircularFlag } from '@iseer/flags';

function MyComponent() {
  return <CircularFlag countryCode="bd" height="50" />;
}

For example, the following code:

<CircularFlag countryCode="br" height="48" />
<CircularFlag countryCode="cn" height="48" />
<CircularFlag countryCode="gb" height="48" />
<CircularFlag countryCode="id" height="48" />
<CircularFlag countryCode="in" height="48" />
<CircularFlag countryCode="ng" height="48" />
<CircularFlag countryCode="ru" height="48" />
<CircularFlag countryCode="us" height="48" />

...produces this:

Rectangular Flags

import { RectangularFlag } from '@iseer/flags';

function MyComponent() {
  return <RectangularFlag countryCode="us" height="30" />;
}

For example, the following code:

<RectangularFlag countryCode="br" height="32" />
<RectangularFlag countryCode="cn" height="32" />
<RectangularFlag countryCode="gb" height="32" />
<RectangularFlag countryCode="id" height="32" />
<RectangularFlag countryCode="in" height="32" />
<RectangularFlag countryCode="ng" height="32" />
<RectangularFlag countryCode="ru" height="32" />
<RectangularFlag countryCode="us" height="32" />

...produces this:

📋 Props

Both CircularFlag and RectangularFlag accept:

| Prop | Type | Required | Default | Description | |------|------|----------|---------|-------------| | countryCode | string | Yes | - | ISO country code (e.g., 'us', 'bd', 'gb') | | height | number \| string | No | 100 | Height of the flag image | | ...rest | ImgHTMLAttributes | No | - | All standard <img> tag attributes |

All standard <img> attributes are supported:

<CircularFlag 
  countryCode="gb" 
  height="40"
  className="shadow-lg"
  style={{ cursor: 'pointer' }}
  onClick={() => console.log('Flag clicked!')}
  alt="United Kingdom Flag"
/>

🌍 Available Flags

  • Circular flags: 423 country codes
  • Rectangular flags: 262 country codes

Common Country Codes

bd, us, gb, in, cn, jp, de, fr, ca, au, and many more!

Validation

Invalid country codes automatically fallback to 'xx' (unknown flag).

<CircularFlag countryCode="invalid" /> 
// Displays the 'xx' (unknown) flag

🔍 TypeScript Support

Full TypeScript support included:

import { CircularFlag, CircularFlagProps } from '@iseer/flags';

const MyFlag: React.FC = () => {
  return <CircularFlag countryCode="bd" height="50" />;
};

📊 Checking Valid Codes

You can programmatically check if a country code is valid:

import { circularFlags, rectangularFlags } from '@iseer/flags';

console.log(circularFlags['bd']); // true
console.log(circularFlags['xyz']); // undefined

console.log(rectangularFlags['us']); // true

🎨 Example Usage

Flag Selector

import { CircularFlag } from '@iseer/flags';

function FlagSelector() {
  const countries = ['bd', 'us', 'gb', 'in', 'cn'];
  
  return (
    <div style={{ display: 'flex', gap: '10px' }}>
      {countries.map(code => (
        <CircularFlag 
          key={code} 
          countryCode={code} 
          height="40"
          style={{ cursor: 'pointer' }}
        />
      ))}
    </div>
  );
}

User Profile Badge

<div className="user-profile">
  <RectangularFlag countryCode={user.country} height="25" />
  <span>{user.name}</span>
</div>

⚡ Performance

  • Tiny bundle size: Only ~2KB (flags loaded from CDN)
  • CDN-hosted: Fast delivery via Iseer's global CDN
  • Lazy loading: Flags load on-demand
  • Browser caching: Automatic caching for repeat loads

📝 License

This project is released under the Apache License 2.0.

🔗 Resources

  • CDN Base URL: https://storage.iseer.co/assets/flags/
  • Circular Flags: https://storage.iseer.co/assets/flags/circular_flags/{code}.svg
  • Rectangular Flags: https://storage.iseer.co/assets/flags/retangular_flags/{code}.svg

Made with ❤️ by Iseer