Bahrain

BahrainMap is a ready-made, interactive SVG map of Bahrain's five governorates, built on the shared shadcnmaps Map component. It ships with the bahrain map data and exposes the RegionId type for typed region handling.

Bahrain
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 @shadcnmaps/bahrain

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

Usage

usage.tsx
import { BahrainMap } from '@/components/shadcnmaps/maps/bahrain'<BahrainMap />
  • Showing Bahrain's governorates on a dashboard, store locator, or regional report
  • Letting users pick one of Bahrain's five regions in a form or filter
  • Displaying region-level data such as sales, population, or incidents on a Bahrain map
  • Needing a typed RegionId union for the five Bahrain region identifiers

Examples

Basic map

Renders the Bahrain map with default behavior from the shared Map component.

basic-map.tsx
import { BahrainMap } from '@/components/shadcnmaps/maps/bahrain'export function BahrainSection() {  return (    <section>      <h2>Bahrain governorates</h2>      <BahrainMap />    </section>  )}

Typed region labels

Uses the exported RegionId type so every region key is checked at compile time.

typed-region-labels.tsx
import type { RegionId } from '@/components/shadcnmaps/maps/bahrain'const regionLabels: Record<RegionId, string> = {  AJ: 'Al-Janūbīyah',  AS: 'Ash-Shamālīyah',  AM: 'Al-Muḥarraq',  AW: 'Al-Wusṭā',  'AM-2': 'Al-Manāmah',}export const bahrainRegionOptions = Object.entries(regionLabels).map(([id, label]) => ({ id, label }))

Map inside a card layout

Places the map in a constrained container so it scales with the page layout.

map-inside-a-card-layout.tsx
import { BahrainMap } from '@/components/shadcnmaps/maps/bahrain'export function RegionCard() {  return (    <div className="mx-auto w-full max-w-sm rounded-lg border p-4">      <p className="mb-2 text-sm font-medium">Bahrain</p>      <BahrainMap />    </div>  )}

API reference

PropTypeDefaultDescription
...props (BahrainMapProps)Omit<MapProps, 'data'>—BahrainMapProps extends MapProps from the shared map registry item with the data prop removed, because the bahrain map data is fixed. Accepted props are defined by MapProps in map.json, which is not part of this item's source. Any props passed are spread onto the Map component.
RegionId (type export)'AJ' | 'AS' | 'AM' | 'AW' | 'AM-2'—Union of the five region identifiers in the bahrain map data. Exported as a type, not a prop.

Accessibility

  • Region paths come from the shared Map component; verify it sets role, focusable state, and an accessible name for each region
  • Each region has a human-readable name (for example Al-Manāmah) in the data, so pair the map with a text list or legend for screen reader users
  • AM and AM-2 share the abbreviation AM, so do not rely on abbreviations alone to identify regions; use the id or name
  • Provide a visible heading or caption describing the map's purpose
  • Ensure any interactive region states such as hover or selection are also conveyed by non-color cues and keyboard focus indicators

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 "Bahrain" component (shadcnmaps/bahrain) from its shadcn registry.1. Install it with: npx shadcn@latest add @shadcnmaps/bahrain2. 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: ...props (BahrainMapProps), RegionId (type export).Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { BahrainMap } from '@/components/shadcnmaps/maps/bahrain'<BahrainMap />```

Files & dependencies

  • registry/shadcnmaps/maps/bahrain.tsx→ components/shadcnmaps/maps/bahrain.tsx
  • registry/shadcnmaps/map-data/bahrain.ts→ components/shadcnmaps/map-data/bahrain.ts
registryDependencieshttps://shadcnmaps.com/r/map.json

Looks similar, elsewhere