Republic of the Congo Flag

A typed React component that renders the Republic of the Congo flag by wrapping the shared Flag primitive with code fixed to "cg". It supports no-crop 4:3 and 1:1 frames and the svg, png, webp, and jpg formats listed in its metadata.

componentflagscountriesinternationalizationregistry-item.json
Republic of the Congo Flag
LIVE · running in a sandboxed iframe
Installed with plain shadcn add · no workarounds · theme neutral (none shipped)
See how it was built

Installation

pnpm dlx shadcn@latest add @flagcn/cg

Requires @flagcn in the registries of your components.json (shadcn adds official directory namespaces automatically).

Usage

usage.tsx
import { RepublicOfTheCongoFlag } from "@/components/flags/countries/cg"export function CountryBadge() {  return <RepublicOfTheCongoFlag className="h-6 w-8" />}
  • Showing the Republic of the Congo flag next to a country name in a country picker, address form, or profile card.
  • Displaying the flag in a multilingual or international UI where country identity needs a recognizable icon.
  • Listing participants, delegations, or shipping destinations where each row needs a consistent flag.
  • Choosing a fixed 4:3 or 1:1 frame when a layout requires the flag at a specific aspect ratio.

Examples

Country picker option

Shows the flag beside the country name in a select list item.

country-picker-option.tsx
import { RepublicOfTheCongoFlag } from "@/components/flags/countries/cg"export function CountryOption() {  return (    <div className="flex items-center gap-2">      <RepublicOfTheCongoFlag className="h-4 w-6" />      <span>Republic of the Congo</span>    </div>  )}

Custom alt text

Overrides the default alt text when the surrounding context already names the country.

custom-alt-text.tsx
import { RepublicOfTheCongoFlag } from "@/components/flags/countries/cg"export function DeliveryDestination() {  return <RepublicOfTheCongoFlag alt="Flag of Congo for delivery destination" className="h-8 w-8" />}

Square avatar-style flag

Uses a square container for a compact 1:1 presentation in a team or delegation list.

square-avatar-style-flag.tsx
import { RepublicOfTheCongoFlag } from "@/components/flags/countries/cg"export function DelegationAvatar() {  return (    <div className="size-10 overflow-hidden rounded-full">      <RepublicOfTheCongoFlag className="size-full object-cover" />    </div>  )}

API reference

PropTypeDefaultDescription
altstring"Republic of the Congo flag"Accessible text for the flag image. Defaults to "Republic of the Congo flag" when omitted.
...propsOmit<FlagProps, "code">—All other props of FlagProps from the @flagcn/flag primitive are forwarded to Flag. The code prop is omitted because it is fixed to "cg". The full FlagProps definition lives in the flag registry item and is not included in this item's source.

Accessibility

  • The default alt text "Republic of the Congo flag" is announced by screen readers when no alt is passed.
  • Pass a more specific alt when the flag appears next to the country name, or set alt to an empty string only when the adjacent text already names the country, so the flag is not announced twice.
  • Do not rely on color alone to identify the country in critical UI; keep the country name visible or available as text.

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.

prompt.md
Use the "Republic of the Congo Flag" component (flagcn/cg) from its shadcn registry.1. Install it with: npx shadcn@latest add @flagcn/cg2. 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.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { RepublicOfTheCongoFlag } from "@/components/flags/countries/cg"export function CountryBadge() {  return <RepublicOfTheCongoFlag className="h-6 w-8" />}```

Files & dependencies

  • src/components/flags/countries/cg.tsx→ @components/flags/countries/cg.tsx
registryDependencies@flagcn/flag

Looks similar, elsewhere