Overview
Reference usage
MapMarker is an anchored pin for a map you render yourself: a pill over a 10px rotated square whose point marks the place. It has four states. live is a filled pill with a dot, idle is an outlined pill that shows a start time or glyph, selected is raised with a ring, and cluster is a round count with no tail. State is never carried by colour alone, and the button is at least 44px in both directions.
MapMarker does not choose a map library or basemap. Position it over the map at the point its tail marks. A map that draws markers must also render MapLegend's attribution.
Usage
When to use
- Placing a place or a group of places on a map you render yourself, with the map library of your choice.
- Showing which pin is selected with a raised pill and a ring.
- Showing a status next to text outside a map — use status-dot.
- Explaining the marker states — use map-legend.
Examples
Live, idle, selected and cluster
Idle shows its start time, live is a filled pill with a dot, selected is raised with a ring, and a cluster is a round count. Each is at least 44px.
Props
Name | Type | Default | Description |
|---|---|---|---|
state | 'live' | 'idle' | 'selected' | 'cluster' | 'idle' | The marker's state. live is a filled pill with a dot, idle an outlined pill, selected a raised pill with a ring, and cluster a round count with no tail. Defaults to idle. |
label required | text | Visible text: a start time such as "8 pm" for an idle marker, a short word for a live one, or the count for a cluster. State is never carried by colour alone. | |
icon | snippet | Decorative glyph drawn before the label. It is hidden from assistive technology. | |
name | text | Accessible name of the marker, such as "Union Station Bar, happy hour starts 8 pm". Left unset, the label is the name and the state is appended as hidden text. |