SVG version
Use the SVG files for the web and design tools - they scale without quality loss and come in four visual styles.
Installation
npm install @tabler/flagsyarn add @tabler/flagspnpm install @tabler/flagsbun install @tabler/flagsor just download from GitHub.
Usage
The package has one directory per visual style, and one SVG file per flag inside it. The file name is the flag's slug, for example poland.svg:
node_modules/@tabler/flags/dist/
rounded/poland.svg
plain/poland.svg
gradient/poland.svg
shiny/poland.svg
flags.json
roundedis the default look, with rounded corners and a thin inset border - the same look as the CSS plugin.plainis the bare flag on a 5:4 canvas, for when you draw your own frame.gradientandshinyadd a soft shading on top of the flag.
Load a file as an image and set its size with CSS. Every flag has the same 5:4 ratio, so set the width or the height and the other side follows:
<img src="node_modules/@tabler/flags/dist/rounded/poland.svg" alt="Poland" width="30" height="24" />
A flag can also be a background-image, which is how the CSS plugin works:
.flag-poland {
background: url('node_modules/@tabler/flags/dist/plain/poland.svg') no-repeat center / cover;
}
List of flags
flags.json lists every flag with its name, category and ISO code, keyed by slug. Use it to build a country select or to map an ISO code to a file:
import flags from '@tabler/flags/flags.json';
flags.poland; // { name: 'Poland', category: 'Countries', iso: 'PL' }
The full list of flags, slugs and ISO codes is in the repository README.

