GeoIcons brings 799 country and region SVG icons to React with simple imports
A new open-source package called GeoIcons offers 799 country, area, and subdivision icons as individual named React components, addressing a common gap in mainstream icon libraries. Developers can install it via npm and import icons using ISO 3166 alpha-2 codes in PascalCase, such as UnitedStates, Fr, or Jp. The package ships as ES modules with no runtime dependencies beyond React, allowing bundlers to tree-shake unused icons and keep bundle sizes small. Icons accept props for size, color, stroke weight, and accessibility labels, and default to currentColor so they adapt automatically to surrounding styles. For dynamic use cases where the country is only known at runtime, developers are advised to build a custom lookup map using only the icons they explicitly import.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in