Eswatini (Swaziland) Flag

A typed wrapper component that renders the Eswatini (Swaziland) national flag through the shared flagcn Flag primitive, with the country code fixed to "sz" and a default English alt text. It depends on the @flagcn/flag base and supports the registry's SVG, PNG, WebP, and JPEG assets.

componentflagscountriesinternationalizationregistry-item.json
Eswatini (Swaziland) 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/sz

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

Usage

usage.tsx
import { EswatiniSwazilandFlag } from "@/components/flags/countries/sz"export function CountryBadge() {  return <EswatiniSwazilandFlag />}
  • Showing Eswatini's flag next to a country name in a country picker, select list, or directory listing.
  • Displaying a country flag in a profile, address, shipping, or localization settings UI.
  • Rendering a flag in a dashboard or table where a consistent, typed flag component per country is needed.
  • Building a flag grid or list that composes many per-country components from the same flags folder.

Examples

Basic flag

Render the flag with the default alt text.

basic-flag.tsx
import { EswatiniSwazilandFlag } from "@/components/flags/countries/sz"export function Basic() {  return <EswatiniSwazilandFlag />}

Country picker option

Use the flag inside a select option row with a custom alt label.

country-picker-option.tsx
import { EswatiniSwazilandFlag } from "@/components/flags/countries/sz"export function CountryOption() {  return (    <div className='flex items-center gap-2'>      <EswatiniSwazilandFlag alt='Flag of Eswatini' className='h-4 w-6' />      <span>Eswatini</span>    </div>  )}

Profile location card

Pass a className to size the flag inside a profile card.

profile-location-card.tsx
import { EswatiniSwazilandFlag } from "@/components/flags/countries/sz"export function LocationCard() {  return (    <section className='rounded-md border p-4'>      <p className='text-sm text-muted-foreground'>Country</p>      <EswatiniSwazilandFlag className='mt-2 h-8 w-auto' />    </section>  )}

Flag grid

Compose several flag components in a responsive grid.

flag-grid.tsx
import { EswatiniSwazilandFlag } from "@/components/flags/countries/sz"export function FlagGrid() {  return (    <div className='grid grid-cols-3 gap-4'>      <EswatiniSwazilandFlag />      <EswatiniSwazilandFlag alt='Eswatini flag, small' className='h-10 w-auto' />    </div>  )}

API reference

PropTypeDefaultDescription
altstring"Eswatini (Swaziland) flag"Accessible text for the flag image. Defaults to "Eswatini (Swaziland) flag"; override it when the flag is shown next to a visible country name or when it is purely decorative context.
...propsOmit<FlagProps, "code">—All remaining FlagProps are forwarded to the base Flag component. The exact prop names (such as ratio or format options) are defined in the @flagcn/flag base component and are not part of this item's source, so consult that registry item for the full list. The code prop is omitted and fixed to "sz".

Accessibility

  • The default alt text "Eswatini (Swaziland) flag" is applied automatically, so the image is announced without extra work.
  • When the flag appears beside the visible text "Eswatini", consider passing alt as an empty string so screen readers do not announce the name twice; verify this against the base Flag's handling of empty alt.
  • Do not rely on color alone to identify the country; pair the flag with a text label in forms and pickers.
  • Keep the flag's rendered size large enough to be recognizable and ensure surrounding text meets contrast requirements.

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 "Eswatini (Swaziland) Flag" component (flagcn/sz) from its shadcn registry.1. Install it with: npx shadcn@latest add @flagcn/sz2. 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 { EswatiniSwazilandFlag } from "@/components/flags/countries/sz"export function CountryBadge() {  return <EswatiniSwazilandFlag />}```

Files & dependencies

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

Looks similar, elsewhere