Liberia Flag

LiberiaFlag is a typed React wrapper around the shared Flag component that renders the Liberian national flag with the code fixed to "lr". It supports no-crop 4:3 and 1:1 frames and the SVG, PNG, WebP, and JPEG asset formats listed in the registry metadata.

componentflagscountriesinternationalizationregistry-item.json
Liberia 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/lr

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

Usage

usage.tsx
import { LiberiaFlag } from "@/components/flags/countries/lr"export function CountryBadge() {  return <LiberiaFlag />}
  • Showing the flag of Liberia next to a country name in a country picker, address form, or select list.
  • Displaying Liberia in a list of world flags, sports team or delegation lists, or travel and shipping pages.
  • Rendering the flag at a fixed 4:3 or 1:1 frame without cropping, using the Flag base's ratio options.
  • Replacing hand-written image tags for Liberia with a typed component that always uses the correct country code.

Examples

Default flag

Renders the Liberia flag with the default alt text "Liberia flag".

default-flag.tsx
import { LiberiaFlag } from "@/components/flags/countries/lr"export default function Example() {  return <LiberiaFlag />}

Country picker option

Shows the flag beside the country name in a select option label.

country-picker-option.tsx
import { LiberiaFlag } from "@/components/flags/countries/lr"export function CountryOption() {  return (    <div className="flex items-center gap-2">      <LiberiaFlag alt="Flag of Liberia" />      <span>Liberia</span>    </div>  )}

Custom alt text in a list

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

custom-alt-text-in-a-list.tsx
import { LiberiaFlag } from "@/components/flags/countries/lr"export function DelegationList() {  return (    <ul>      <li>        <LiberiaFlag alt="" />        Liberia delegation      </li>    </ul>  )}

API reference

PropTypeDefaultDescription
altstring"Liberia flag"Accessible text for the flag image. Defaults to "Liberia flag". Pass an empty string when the flag is decorative and the country name is already present nearby.
...propsOmit<FlagProps, "code">—All other FlagProps from the shared Flag component are forwarded to Flag. The code prop is omitted from the public type because LiberiaFlag always sets it to "lr". Refer to the @flagcn/flag source for the full list.

Accessibility

  • The default alt text "Liberia flag" is announced by screen readers. Override it with a more specific phrase when context requires it.
  • If the flag appears directly beside the visible text "Liberia", set alt to an empty string so the name is not read twice.
  • Because the code is fixed to "lr", no runtime lookup can fail, so the component does not need a fallback label of its own.
  • The artwork is a static image with no motion, so no reduced-motion handling is 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.

prompt.md
Use the "Liberia Flag" component (flagcn/lr) from its shadcn registry.1. Install it with: npx shadcn@latest add @flagcn/lr2. 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 { LiberiaFlag } from "@/components/flags/countries/lr"export function CountryBadge() {  return <LiberiaFlag />}```

Files & dependencies

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

Looks similar, elsewhere