affectUI › Illustrations › Maps

DACH Region

DACH map with fading neighbours and a pastel band along the border, switchable to the US, China, India, Brazil or Japan.

Free and open source (MIT). Install: npx shadcn@latest add https://www.affectui.com/r/region-dach.json · Import from @/components/ui/region-dach

When to use

  • Showing a service area, sales territory or market focus in Germany, Austria and Switzerland
  • Sections about regional exclusivity or local presence in one of the larger markets (US, China, India, Brazil, Japan), next to a short text

When not to use

  • Maps that need cities, regions or exact borders – the shapes are simplified and there are no labels

Usage

import { RegionDach } from "@/components/ui/region-dach";

export function TerritorySection() {
  return (
    <section style={{ maxWidth: 420 }}>
      <RegionDach />
    </section>
  );
}

Props

NameTypeDefaultDescription
region"dach" | "us" | "cn" | "in" | "br" | "jp"Shown region (controlled). Pair it with onRegionChange to keep the menu working
defaultRegionRegion"dach"Region shown first when region is not set
onRegionChange(region: Region) => voidCalled when the viewer picks a region in the menu
showSwitcherbooleantrueShow the region menu in the top-left corner
labelstring | ((region: Region) => string)"Map of the DACH region: Germany, Austria and Switzerland" / "Map of Japan" …Accessible description of the map; by default it follows the current region
classNamestringExtra class on the root, e.g. for width or margins

Keyboard

  • Enter / Space: On the menu button: open the region list. In the list: pick the highlighted region
  • ArrowDown / ArrowUp: On the menu button: open the list. In the list: move through the regions
  • Home / End: Jump to the first or last region
  • Escape: Close the list and return focus to the menu button
  • Tab: Close the list and move on

Accessibility

  • The map is one image whose label names the current region; the shapes inside are hidden from screen readers
  • The menu button reports the current region and its expanded state; the list is a listbox with options, the selected one marked with aria-selected

Responsive

  • Transparent background; the neighbouring countries fade out towards the edges, so it sits on any light or dark surface
  • Keeps a 540 : 440 aspect ratio and scales to the width of its container – set a width or max-width via className
  • The menu scales down with the illustration (to about 60 %) so it still fits in small previews
  • The file embeds the map data for all six regions (about 155 KB)
  • Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"

Requirements

  • React 19