Wisconsin Flag

WisconsinFlag is a typed React component that renders the Wisconsin state flag by wrapping the shared Flag component with the code "us-wi". It is part of the flagcn country flag set and supports no-crop 4:3 and 1:1 frames.

componentflagscountriesinternationalizationregistry-item.json
Wisconsin 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-wi

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

Usage

usage.tsx
import { WisconsinFlag } from "@/components/flags/countries/us-wi"export function WisconsinBadge() {  return <WisconsinFlag />}
  • Show the Wisconsin state flag in a US state picker, address form, or location selector.
  • Display Wisconsin alongside other US state or country flags in a grid or list.
  • Use it in a dashboard, profile, or event page where a Wisconsin-specific flag is needed.
  • Choose this over the generic Flag component when you want type-safe access to the Wisconsin code without passing "us-wi" manually.

Examples

Default usage

Render the Wisconsin flag with the default accessible label.

default-usage.tsx
import { WisconsinFlag } from "@/components/flags/countries/us-wi"export function Default() {  return <WisconsinFlag />}

Custom alt text in a state selector

Override the alt text so screen readers announce the context of the flag within a selector option.

custom-alt-text-in-a-state-selector.tsx
import { WisconsinFlag } from "@/components/flags/countries/us-wi"export function StateOption() {  return (    <div className="flex items-center gap-2">      <WisconsinFlag alt="Flag of Wisconsin, selected state" />      <span>Wisconsin</span>    </div>  )}

List of state flags

Render Wisconsin in a list alongside other flag components from the same set.

list-of-state-flags.tsx
import { WisconsinFlag } from "@/components/flags/countries/us-wi"export function StateList() {  return (    <ul className="flex flex-col gap-3">      <li className="flex items-center gap-2">        <WisconsinFlag />        <span>Wisconsin</span>      </li>    </ul>  )}

API reference

PropTypeDefaultDescription
altstring"Wisconsin flag"Accessible text for the flag image. Defaults to "Wisconsin flag" when omitted.
...propsOmit<FlagProps, "code">—All remaining FlagProps from ../flag except code, which is fixed to "us-wi". The exact fields are defined by the @flagcn/flag registry dependency and are not reproduced here.

Accessibility

  • The default alt text "Wisconsin flag" is provided so the image is announced to screen reader users without extra configuration.
  • Pass a more specific alt value when the flag appears next to a visible label that already names Wisconsin, to avoid redundant announcements, or when the flag conveys a selected state.
  • If the flag is purely decorative beside a visible "Wisconsin" text label, the alt should be reviewed so it does not duplicate the label; the Flag implementation determines how empty alt is handled.
  • The code prop cannot be overridden, so the component always renders the Wisconsin flag, which keeps the rendered artwork consistent with its name.

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 "Wisconsin Flag" component (flagcn/us-wi) from its shadcn registry.1. Install it with: npx shadcn@latest add @flagcn/us-wi2. 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 { WisconsinFlag } from "@/components/flags/countries/us-wi"export function WisconsinBadge() {  return <WisconsinFlag />}```

Files & dependencies

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

Looks similar, elsewhere