Algeria Flag

AlgeriaFlag is a typed React component that renders the Algeria national flag through the shared @flagcn/flag base. It is a thin wrapper that fixes code to "dz" and defaults alt to "Algeria flag".

componentflagscountriesinternationalizationregistry-item.json
Algeria 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/dz

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

Usage

usage.tsx
import { AlgeriaFlag } from "@/components/flags/countries/dz"export function Example() {  return <AlgeriaFlag />}
  • Show Algeria's national flag next to its name in country pickers, country lists, or select menus.
  • Display the flag in profile, account, or location metadata for users or organizations tied to Algeria.
  • Build internationalization or localization UIs that need a typed, per-country flag component.
  • Render a consistently framed flag (4:3 or 1:1) in tables, cards, or badges.

Examples

Basic flag

Renders the Algeria flag with the default alt text.

basic-flag.tsx
import { AlgeriaFlag } from "@/components/flags/countries/dz"export function BasicFlag() {  return <AlgeriaFlag />}

Custom alt text in a country picker

Overrides the default alt so screen readers announce the country in the current UI language.

custom-alt-text-in-a-country-picker.tsx
import { AlgeriaFlag } from "@/components/flags/countries/dz"export function CountryOption() {  return (    <div className="flex items-center gap-2">      <AlgeriaFlag alt="アルジェリアの国旗" />      <span>アルジェリア</span>    </div>  )}

Decorative flag beside a visible label

Passes an empty alt when the country name is already announced by adjacent text, so the flag is not read twice.

decorative-flag-beside-a-visible-label.tsx
import { AlgeriaFlag } from "@/components/flags/countries/dz"export function DecorativeFlag() {  return (    <li className="flex items-center gap-2">      <AlgeriaFlag alt="" />      <span>Algeria</span>    </li>  )}

API reference

PropTypeDefaultDescription
altstring"Algeria flag"Accessible text for the flag image. Defaults to "Algeria flag" when omitted. Overrides the default value from the destructured parameter.
...propsOmit<FlagProps, "code">—All other props of FlagProps from ../flag are forwarded to Flag, except code, which is fixed to "dz". The exact list of remaining props is defined in src/components/flags/flag.tsx and is not reproduced in this registry item.

Accessibility

  • The default alt is "Algeria flag", so the image has a meaningful name without any extra work.
  • Pass a localized alt such as "アルジェリアの国旗" when the UI language differs from English.
  • Pass alt="" only when adjacent text already names the country, so screen readers do not announce it twice.
  • The component sets no ARIA roles itself. Any role or aria-* attribute forwarded through FlagProps is applied by the underlying Flag component.

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 "Algeria Flag" component (flagcn/dz) from its shadcn registry.1. Install it with: npx shadcn@latest add @flagcn/dz2. 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 { AlgeriaFlag } from "@/components/flags/countries/dz"export function Example() {  return <AlgeriaFlag />}```

Files & dependencies

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

Looks similar, elsewhere