Gabon Flag
GabonFlag is a typed React wrapper that renders the Gabon national flag through the shared @flagcn/flag base component, with the country code fixed to "ga". It defaults alt to "Gabon flag" and forwards all other FlagProps.


shadcn add · no workarounds · theme neutral (none shipped)Installation
Requires @flagcn in the registries of your components.json (shadcn adds official directory namespaces automatically).
Usage
import { GabonFlag } from "@/components/flags/countries/ga"export function CountryBadge() { return <GabonFlag />}- Showing Gabon's flag next to other country flags in a language picker, country selector, or locale switcher.
- Displaying the flag in a profile, shipping address, or event page where Gabon is the selected country.
- Rendering a flag in a fixed 4:3 or 1:1 slot without cropping the design.
- Building a typed flag list where each country component is imported explicitly, rather than selected by a string code at runtime.
Examples
Default usage
Renders the Gabon flag with the default alt text "Gabon flag".
import { GabonFlag } from "@/components/flags/countries/ga"export function Default() { return <GabonFlag />}Custom alt text
Overrides the default alt text for a more descriptive label in context.
import { GabonFlag } from "@/components/flags/countries/ga"export function NationalFlag() { return <GabonFlag alt="Flag of the Gabonese Republic" />}Country selector row
Places the flag beside a label inside a simple selector item.
import { GabonFlag } from "@/components/flags/countries/ga"export function CountryOption() { return ( <div className="flex items-center gap-2"> <GabonFlag alt="" /> <span>Gabon</span> </div> )}Forwarding props from a wrapper
Wraps GabonFlag and passes through every prop except alt, which is fixed by the wrapper.
import { GabonFlag, type GabonFlagProps } from "@/components/flags/countries/ga"type WrapperProps = Omit<GabonFlagProps, "alt">export function FixedAltGabonFlag(props: WrapperProps) { return <GabonFlag alt="Gabon flag" {...props} />}API reference
Accessibility
- The default alt text "Gabon flag" is announced by screen readers when the image is focused or read in context.
- Pass a more specific alt, such as the name of the country's government or the context of use, when the flag carries meaning beyond the country name.
- If the country name appears in adjacent text, set alt="" so the flag is treated as decorative and is not announced twice.
- The component does not add interactive behavior, so it needs no keyboard handling or focus styles of its own; wrap it in a button or link if it must be clickable.
- Do not rely on color alone to identify the country when the flag is the only cue, because the image is the only representation in that case; include a visible or accessible country name where needed.
Docs written by anthropic:claude-haiku-5-5 from the registry source.
Use with Coding Agent
Paste this into Claude Code, Codex or Cursor. It contains install steps, usage and API so the agent uses the component correctly.
Use the "Gabon Flag" component (flagcn/ga) from its shadcn registry.1. Install it with: npx shadcn@latest add @flagcn/ga2. Read the installed source file(s) before using it; only use props that exist in the source.3. Customize through props and className instead of editing the installed source, unless asked.4. Available props: alt, ...props (FlagProps without "code").Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { GabonFlag } from "@/components/flags/countries/ga"export function CountryBadge() { return <GabonFlag />}```Files & dependencies
- src/components/flags/countries/ga.tsx→ @components/flags/countries/ga.tsx