Skip to content

Flag Icon

Country flag by ISO code.

Installation

bun add @xerobi/ui
import { FlagIcon } from "@xerobi/ui/flag-icon"

This component is client-side. In Astro, hydrate it with a client directive.

API reference

FlagIcon

PropTypeDescription
codestringISO 3166-1 alpha-2 country code, e.g. "BD".
getFlagSrc(code: string) => stringWhere flag images come from. Defaults to the country-flag-icons set on GitHub Pages.

Search documentation

Search pages, components and blocks.