Cook Islands Flag

CookIslandsFlag is a typed React component that renders the Cook Islands flag through the shared flagcn Flag primitive. It is a thin wrapper that fixes the code to "ck" and defaults the alt text to "Cook Islands flag".

componentflagscountriesinternationalizationregistry-item.json
Cook Islands 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/ck

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

Usage

usage.tsx
import { CookIslandsFlag } from "@/components/flags/countries/ck"export function CountryBadge() {  return <CookIslandsFlag />}
  • Show the Cook Islands flag next to a country name in a country picker, address form, or directory listing.
  • Display the flag in travel, sports, or event pages that list participating nations.
  • Use it in internationalization or localization UIs where a typed, per-country component is preferred over passing a raw code string.
  • Render the flag in a fixed 4:3 or 1:1 frame in a dashboard, table, or card where no-crop framing matters.

Examples

Default flag

Renders the flag with the default alt text "Cook Islands flag".

default-flag.tsx
import { CookIslandsFlag } from "@/components/flags/countries/ck"export function DefaultCookIslandsFlag() {  return <CookIslandsFlag />}

Custom alt text in a country row

Overrides alt when the flag sits beside a visible country name, so screen readers do not repeat the label.

custom-alt-text-in-a-country-row.tsx
import { CookIslandsFlag } from "@/components/flags/countries/ck"export function CountryRow() {  return (    <div className="flex items-center gap-2">      <CookIslandsFlag alt="" />      <span>Cook Islands</span>    </div>  )}

Decorative flag inside a labeled button

Uses the flag as a visual cue inside a button whose accessible name already describes the action.

decorative-flag-inside-a-labeled-button.tsx
import { CookIslandsFlag } from "@/components/flags/countries/ck"import { Button } from "@/components/ui/button"export function SelectCountryButton() {  return (    <Button variant="outline">      <CookIslandsFlag alt="" />      Select Cook Islands    </Button>  )}

Flag list from a typed array

Maps a small list of countries to their typed flag components.

flag-list-from-a-typed-array.tsx
import { CookIslandsFlag } from "@/components/flags/countries/ck"const countries = [  { name: "Cook Islands", Flag: CookIslandsFlag },]export function CountryFlagList() {  return (    <ul>      {countries.map(({ name, Flag }) => (        <li key={name} className="flex items-center gap-2">          <Flag alt={name} />          <span>{name}</span>        </li>      ))}    </ul>  )}

API reference

PropTypeDefaultDescription
altstring"Cook Islands flag"Accessible text for the flag image. Defaults to "Cook Islands flag". Pass an empty string when the flag is decorative and a visible label already names the country.
...propsOmit<FlagProps, "code">—All remaining props of the shared Flag component from @flagcn/flag, forwarded unchanged. The code prop is removed from the type and is always set to "ck" internally. The exact list depends on the installed FlagProps type.

Accessibility

  • The default alt text "Cook Islands flag" is announced by screen readers when the flag is an informative image.
  • Pass alt="" when the country name is already present as text nearby, so the flag is hidden from assistive technology and the name is not read twice.
  • Do not rely on color alone to identify the country. Pair the flag with the country name in text when the context is important.
  • Keep the flag inside a container with a visible focus or hover state if it is interactive, such as within a button or link.

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 "Cook Islands Flag" component (flagcn/ck) from its shadcn registry.1. Install it with: npx shadcn@latest add @flagcn/ck2. 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 { CookIslandsFlag } from "@/components/flags/countries/ck"export function CountryBadge() {  return <CookIslandsFlag />}```

Files & dependencies

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

Looks similar, elsewhere