Custom label to be used by screen readers. When provided, an aria-label will be added to the element.
string
"a user friendly label for screen readers"
How to align along the cross axis when contained in a Box or along the column axis when contained in a Grid.
string
"start"
"center"
"end"
"stretch"
"baseline"
Color when hovering over places while selecting.
string
A hex, name, or rgb value.
"brand"
object
An object with a color for dark and light modes.
{ dark: "string", light: "string" }
Continent details.
array
[ { name: "string", color: "string" | { dark: "white", light: "black" }, onClick: (name) => {}, onHover: (name) => {} }, ]
where name could be:
"Africa"
"Asia"
"Australia"
"Europe"
"North America"
"South America"
Whether the width and/or height should fill the container.
string
"horizontal"
"vertical"
boolean
true
false
Color when hovering over places while selecting.
string
A hex, name, or rgb value.
"brand"
object
An object with a color for dark and light modes.
{ dark: "string", light: "string" }
The amount of margin around the component.
string
"none"
"xxsmall"
"xsmall"
"small"
"medium"
"large"
"xlarge"
object
Can be specified to distinguish horizontal margin, vertical margin, and margin on a particular side.
{ vertical: "...", horizontal: "...", top: "...", bottom: "...", left: "...", right: "..." }
Called when the user clicks on a place. It is passed the location.
function
([lat, lon]) => {}
Place details.
array
'location' is an array of two numeric values that indicates the latitude and longitude of the specified location. It should be given a 'name' for accessibility. 'onClick' and 'onHover' allow user interaction with each place. 'content' and 'dropProps' allow attaching additional content near each place.
[ { color: "string" | { dark: "string", light: "string" }, content: ( <Box pad={{ horizontal: 'small', vertical: 'xsmall' }}> <Text>Sydney</Text> </Box> ), dropProps: { align: { left: 'right' }, background: { color: 'background-contrast' }, margin: { left: 'small' }, round: 'xsmall', }, name: "Sydney", location: [ -33.8830555556, 151.216666667 ], onClick: function, onHover: function }, ]
At its core, the WorldMap component is a regular <svg> element. Thus, both DOM and React properties, methods, and events are accessible. To read up on all of the possible DOM attributes and types available for svg elements, check out this MDN Web Documents page. To learn more about DOM events and methods, you can read more on the MDN Web Events documentation page.
Also, feel free to read about the types of React events available, or see how DOM attributes change in React. Working in tandem with Styled Components, you also have access to the as property.
The color for each individual dot when a color is not passed as a prop.
string
"light-3"
The size of the visual dots belonging to a continent when the continent is being hovered.
string
"8px"
The size of the visual dots belonging to a continent that is not being hovered.
string
"6px"
The size of a visual dot for an individual place in the map when it is being hovered.
string
"20px"
The size of the visual dot representing an individual place in the map when it is not being hovered.
string
"8px"