Skip to content
GitHub

Country Flag

Displays a country flag.

SpainSpain
import { CountryFlag } from "@/components/ui/pxl/country-flag";
export default function CountryFlagDemo() {
return (
<div className="flex flex-row flex-wrap items-center gap-2.5">
<CountryFlag className="w-12" size="sm" code="ESP" />
<CountryFlag className="w-24" size="md" code="ESP" />
</div>
);
}

The <CountryFlag /> component uses the Terrabandiere flags by Roberto Mocci.

pnpm dlx shadcn@latest add pxl-ui/registry/country-flag
import { CountryFlag } from "@/components/ui/pxl/country-flag"
<CountryFlag code="ALPHA3 | ALPHA2 | NUMBER" />

Use the size prop to change the size of the flag.

<CountryFlag code="ESP" size="sm" />

The CountryFlag component displays a country flag

Prop Type Default
code string | number -
size "sm" | "md" | "default" "default"
className string -