Washington Flag

WashingtonFlag is a typed React component that renders the flag of the U.S. state of Washington through the shared @flagcn/flag base component, with the code fixed to us-wa. It supports no-crop 4:3 and 1:1 frames and ships with SVG, PNG, WebP, and JPEG assets.

componentflagscountriesinternationalizationregistry-item.json
Washington 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/us-wa

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

Usage

usage.tsx
import { WashingtonFlag } from "@/components/flags/countries/us-wa"export function Example() {  return <WashingtonFlag />}
  • Showing the Washington state flag in a country, region, or state selector list or dropdown.
  • Displaying a state flag next to Washington-related content such as addresses, profiles, or regional news.
  • Building internationalization or localization UIs that need a consistent typed flag component for U.S. states.
  • Rendering a flag at a fixed 4:3 or 1:1 frame when the layout needs a predictable box.

Examples

Default usage

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

default-usage.tsx
import { WashingtonFlag } from "@/components/flags/countries/us-wa"export function StateBadge() {  return <WashingtonFlag />}

Custom alt text

Overrides the default alt text so screen readers announce context-specific wording.

custom-alt-text.tsx
import { WashingtonFlag } from "@/components/flags/countries/us-wa"export function ResidencyField() {  return <WashingtonFlag alt="Flag of the State of Washington" />}

Region picker option

Uses the flag inside a list of selectable regions, keyed by state code.

region-picker-option.tsx
import { WashingtonFlag } from "@/components/flags/countries/us-wa"const regions = [{ code: "us-wa", label: "Washington" }]export function RegionList() {  return (    <ul>      {regions.map((r) => (        <li key={r.code}>          <WashingtonFlag alt={`${r.label} flag`} />          {r.label}        </li>      ))}    </ul>  )}

API reference

PropTypeDefaultDescription
altstring"Washington flag"Accessible alternative text for the flag image. Defaults to "Washington flag" when omitted.
...propsOmit<FlagProps, "code">—All other props from FlagProps exported by @flagcn/flag (for example ratio or format options defined there), except code, which is fixed to "us-wa". Refer to the FlagProps definition in src/components/flags/flag for the exact names and types.

Accessibility

  • The default alt text "Washington flag" is applied, so the flag is announced without extra configuration.
  • Pass a context-specific alt when the flag appears next to text that already names Washington, to avoid repetitive announcements.
  • If the flag is purely decorative beside a visible label, consider overriding alt with an empty string so screen readers skip it, but only if the FlagProps implementation forwards that value to the image element.
  • Because the component is a static image, it does not add focus, keyboard, or motion behavior; wrap it in an interactive element when it needs to be clickable.

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

Files & dependencies

  • src/components/flags/countries/us-wa.tsx→ @components/flags/countries/us-wa.tsx
registryDependencies@flagcn/flag

Looks similar, elsewhere