Choose Astro, React, or Elements to compare native usage against the shared visual output. Each example assumes the framework-level setup is already complete.
Dotted destinations
AstroCode target · live preview uses Astro
Places worth remembering
Your own destinations, your own colors. Sample data for this demo.
Colombia
Japan
Portugal
Spain
United States
Brazil
Australia
Bogotá
Tokyo
Lisbon
Illustrative destinations. Hover over the map or choose a country to explore.
View WorldMap code
Framework usage
Switch targets to compare the adapter code. This live preview runs the Astro example. React and Elements use their own behavior APIs; complete the matching framework setup before copying an example.
astro
---
import { WorldMap } from '@santi020k/lumen-astro'
import { lumenWorldMapCountries } from '@santi020k/lumen-core/world-map-data'---<WorldMapcaption="Illustrative destinations. Hover over the map or choose a country to explore."countries={lumenWorldMapCountries}description="Your own destinations, your own colors. Sample data for this demo."heading="Places worth remembering"highlightedCountries={['CO', 'JP', 'PT', 'ES', 'US', 'BR', 'AU']}label="World map showing sample destinations"markers={[
{id: 'bogota', label: 'Bogotá', latitude: 4.71, longitude: -74.07 },
{id: 'tokyo', label: 'Tokyo', latitude: 35.68, longitude: 139.69 },
{id: 'lisbon', label: 'Lisbon', latitude: 38.72, longitude: -9.14 }
]}/>
Use Lumen accent colors and country labels to match your product.
AstroCode target · live preview uses Astro
Colombia
日本
Portugal
Solid styling with Lumen accent colors and localized country labels.
View WorldMap code
Framework usage
Switch targets to compare the adapter code. This live preview runs the Astro example. React and Elements use their own behavior APIs; complete the matching framework setup before copying an example.
astro
---
import { WorldMap } from '@santi020k/lumen-astro'
import { lumenWorldMapCountries } from '@santi020k/lumen-core/world-map-data'---<WorldMapanimated={false}caption="Solid styling with Lumen accent colors and localized country labels."countries={lumenWorldMapCountries}highlightedCountries={['CO', 'JP', 'PT']}label="Sample destinations with a solid map style"labels={{CO: 'Colombia', JP: '日本', PT: 'Portugal'}}listLabel="Explore a country"style="--ui-world-map-highlight: hsl(var(--accent));"variant="solid"/>
tsx
importtype{ CSSProperties }from'react'import{ WorldMap }from'@santi020k/lumen-react'import{ lumenWorldMapCountries }from'@santi020k/lumen-core/world-map-data'const style: CSSProperties &{'--ui-world-map-highlight':string}={'--ui-world-map-highlight':'hsl(var(--accent))'}const Example =()=>(<WorldMap countries={lumenWorldMapCountries} label="Sample destinations with a solid map style"
highlightedCountries={['CO','JP','PT']} variant="solid" animated={false}
labels={{ CO:'Colombia', JP:'日本', PT:'Portugal'}} listLabel="Explore a country" style={style}/>)
html
<scripttype="module">
import { defineLumenWorldMap, LumenWorldMapElement } from '@santi020k/lumen-elements/components/world-map'
import { lumenWorldMapCountries } from '@santi020k/lumen-core/world-map-data'
import '@santi020k/lumen-elements/styles.css'
defineLumenWorldMap()
const map = document.querySelector('lumen-world-map')
if (map instanceof LumenWorldMapElement) map.countries = lumenWorldMapCountries
</script><lumen-world-mapvariant="solid"animated="false"labels='{"JP":"日本"}'list-label="Explore a country"style="--ui-world-map-highlight: hsl(var(--accent))"label="Sample destinations with a solid map style"highlighted-countries='["CO", "JP", "PT"]'></lumen-world-map>
Choose the package for your runtime. All adapters share the Lumen stylesheet. Use the matching registry command when you want a local wrapper for that framework.
bash@santi020k/lumen-astro
pnpm add @santi020k/lumen-astro
pnpm add @santi020k/lumen-astro
bashAstro wrapper
lumen add WorldMap
lumen add WorldMap
bash@santi020k/lumen-react
pnpm add @santi020k/lumen-react
pnpm add @santi020k/lumen-react
bashReact wrapper
lumen add WorldMap --target react
lumen add WorldMap --target react
bash@santi020k/lumen-elements
pnpm add @santi020k/lumen-elements
pnpm add @santi020k/lumen-elements
bashElements wrapper
lumen add WorldMap --target elements
lumen add WorldMap --target elements
API reference
Lumen-specific props and runtime attributes for the Astro primitive. Use the framework differences above and the copyable examples for React composition and Elements attributes; the public adapter types define their supported contracts.
Attribute
Values
Default
Description
initialView
"world" | "highlighted"
"world"
Fits highlighted country geometry on enhancement. The Fit highlighted countries button repeats the fit; reset restores the world. Elements uses initial-view.
zoomable
boolean
true
Shows zoom, fit, and reset controls. Buttons use 50% steps from 100% to 800%. Ctrl/Cmd-scroll zooms toward the cursor; drag or scroll to explore.
zoomLabels
Partial<LumenWorldMapZoomLabels>
English labels
Localizes zoomIn, zoomOut, reset, level, fit and viewport. Elements accepts zoom-labels JSON.
countries
readonly LumenWorldMapCountryGeometry[]
required
Import lumenWorldMapCountries explicitly from @santi020k/lumen-core/world-map-data. Custom geometry uses the fixed 1000 × 400 projection.
label
string
required
Provides the accessible name for the map image.
highlightedCountries
readonly string[]
[]
Country codes to highlight; unknown codes and duplicates are dropped. Elements also accepts highlighted-countries as JSON.
variant
"dotted" | "solid"
"dotted"
Chooses the map appearance.
markers
readonly LumenWorldMapMarker[]
[]
Labeled points with id, latitude and longitude. Invalid or off-map points are dropped.
labels / listLabel
Record<string, string> / string
country names / "Choose a country"
Localizes country names and the native chooser. Elements uses labels JSON and list-label.
selectedCountry
string
-
Initial selection in Astro, reflected selected-country in Elements, controlled selection in React; React also supports defaultSelectedCountry.
interactive / animated
boolean
true
Enable country selection and motion separately. Reduced motion disables animation automatically.
onCountrySelect
(detail: LumenWorldMapSelectDetail) => void
-
React callback; Astro and Elements emit ui:world-map-select with countryId, highlighted and label.
heading / description / caption
string
-
Optional Astro and React figure content. Elements supports authored content outside the map.