Loading component…
Loading component…
World map with one highlighted continent and a pastel band travelling along its coastline, switchable between all six
To reuse this local React demo, copy all files from the Code tab into the same folder, then import WorldMapContinental from ./world-map.
import { WorldMap } from "@/components/ui/world-map";
export function MarketSection() {
return (
<section style={{ maxWidth: 640 }}>
<WorldMap />
</section>
);
}| Name | Type | Default | Description |
|---|---|---|---|
| continent | "north-america" \| "south-america" \| "europe" \| "africa" \| "asia" \| "oceania" | Highlighted continent (controlled). Pair it with onContinentChange to keep the menu working | |
| defaultContinent | Continent | "europe" | Continent highlighted first when continent is not set |
| onContinentChange | (continent: Continent) => void | Called when the viewer picks a continent in the menu | |
| showSwitcher | boolean | true | Show the continent menu in the top-left corner |
| label | string \| ((continent: Continent) => string) | "World map with Europe highlighted" … | Accessible description of the map; by default it follows the current continent |
| className | string | Extra class on the root, e.g. for width or margins |
Transparent background; the solid gray world and the lighter highlighted continent read on light and dark surfaces alike
Keeps a 540 : 242 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 %); on small sizes the open list may extend below the map
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"