vue-country-flag-next is a dedicated Vue 3 component designed for displaying country flags, primarily identified by ISO 3166-1 alpha-2 or alpha-3 codes. The current stable version is 2.3.2, with an active release cadence addressing bug fixes and minor improvements. A key differentiator is its optimized footprint, achieved in v2.1.0 by loading flag images as separate files rather than base64 encoded strings within the CSS, reducing the package size by approximately 700kb. It natively supports TypeScript and integrates seamlessly into Vue 3 projects, offering optional properties for size, rounded borders, and shadows.
npm install vue-country-flag-nextVerified import paths — ran on the pinned version, not inferred.
Demonstrates installation via npm, global registration of the `CountryFlag` component in a Vue 3 application, and basic usage within a template with various `country`, `size`, `rounded`, and `shadow` props.
Ensure your build process and deployment environment are configured to properly serve static assets (e.g., images) from the `node_modules/vue-country-flag-next` directory if you are hosting assets yourself, or ensure your bundler handles it correctly.
Ensure you are importing the component via its main entry point (e.g., `import CountryFlag from 'vue-country-flag-next'`) rather than attempting to directly reference the `.vue` file.
Update to version 2.0.1 or newer to resolve the AdBlock visibility issue for the Andorra flag and other potential CSS-related conflicts.
Ensure your project explicitly depends on Vue 3 (`"vue": "^3.0.0"`) in your `package.json` and that your application is built using Vue 3.
Ensure you have either registered the component globally using `app.component('country-flag', CountryFlag)` (for `main.js`) or locally within a component's `components` option: `components: { CountryFlag }`.Import `CountryFlag` as a component and register it either globally with `app.component()` or locally within another component's `components` option, instead of trying to use `app.use()`.