Bosnia and Herzegovina Flag
BosniaAndHerzegovinaFlag is a typed React wrapper that renders the Bosnia and Herzegovina flag through the shared Flag base component with the code fixed to "ba". It supports the 4:3 and 1:1 no-crop frames and the SVG, PNG, WebP, and JPEG formats provided by the flagcn registry.


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 { BosniaAndHerzegovinaFlag } from "@/components/flags/countries/ba"export function CountryLabel() { return <BosniaAndHerzegovinaFlag alt="Bosnia and Herzegovina flag" />}- Showing Bosnia and Herzegovina's flag next to country names in a country picker, profile, or address form.
- Displaying a consistent, typed flag asset in internationalization or localization UIs such as language or region selectors.
- Rendering flags in tables, lists, or cards where a fixed 4:3 or 1:1 frame keeps layouts aligned.
- Using a named component instead of passing the raw code string when you want compile-time safety for the Bosnia and Herzegovina flag.
Examples
Default flag
Renders the flag with the built-in default alt text, which is applied when no alt prop is passed.
import { BosniaAndHerzegovinaFlag } from "@/components/flags/countries/ba"export function DefaultFlag() { return <BosniaAndHerzegovinaFlag />}Country select option
Shows the flag beside the country name inside a country picker option, with a custom alt text.
import { BosniaAndHerzegovinaFlag } from "@/components/flags/countries/ba"export function CountryOption() { return ( <div className="flex items-center gap-2"> <BosniaAndHerzegovinaFlag alt="Flag of Bosnia and Herzegovina" /> <span>Bosnia and Herzegovina</span> </div> )}Flag list in a table cell
Places the flag in a table cell so it appears alongside other country rows.
import { BosniaAndHerzegovinaFlag } from "@/components/flags/countries/ba"export function FlagCell() { return ( <td className="p-2"> <BosniaAndHerzegovinaFlag alt="Bosnia and Herzegovina flag" /> </td> )}API reference
Accessibility
- The default alt text "Bosnia and Herzegovina flag" is announced by screen readers, so the flag is exposed as a meaningful image.
- When the flag appears next to the country name, pass alt="" to hide the redundant image from assistive technology, or keep the default if the flag is the only identifier.
- Provide a specific alt value when the flag carries meaning that the surrounding text does not already convey.
- The flag has no motion, so it introduces no reduced-motion concerns.
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 "Bosnia and Herzegovina Flag" component (flagcn/ba) from its shadcn registry.1. Install it with: npx shadcn@latest add @flagcn/ba2. 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 (rest of Omit<FlagProps, "code">).Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { BosniaAndHerzegovinaFlag } from "@/components/flags/countries/ba"export function CountryLabel() { return <BosniaAndHerzegovinaFlag alt="Bosnia and Herzegovina flag" />}```Files & dependencies
- src/components/flags/countries/ba.tsx→ @components/flags/countries/ba.tsx