Theme studio

Design a theme, preview it live, then export it. Saved in this browser.

Quick picks #10b981
Generated scale
50100200300400500600700800900
Some text is below AA

MapMarkers

  • Needs review
  • RTL

Many markers from data on a MapView, clustered automatically: nearby markers merge into MapMarkerCluster buttons (with category segments) that zoom in when pressed. Only markers on screen are rendered, and they are reached with Tab in items order, so the map follows the list beside it.

import { MapMarkers } from "@nexera-ui/react";
Loading example…
2
examples
8
props
0
live controls
1
platform
0
WCAG criteria
2
blocks use it

Try every prop. Copy the code.

Change the props and the code updates. Check light and dark, LTR and RTL, and phone width.

Loading…
Generated code
import { MapMarkers } from "@nexera-ui/react";

<MapMarkers />

Examples 1

The same examples as Storybook, rendered live. Open Code to copy one.

Without clustering

cluster={false} shows every marker, for small sets where each one matters.

Loading example…

Props 8

8 props shown

items*Nexera
readonly T[]

The data: people, places, assets.

Default –
getId*Nexera
(item: T) => string

A stable, unique id per item (used by MapView selectedId).

Default –
getLngLat*Nexera
(item: T) => LngLat

The item's position as [lng, lat]. Items without a valid one are skipped (named in the console in development).

Default –
renderMarker*Nexera
(item: T, state: { isSelected: boolean; }) => ReactNode

The marker for one item, for example a MapMarkerPerson.

Default –
getCategoryNexera
(item: T) => string

The item's category, counted per cluster for MapMarkerCluster's segments (with categories).

Default –
categoriesNexera
readonly string[]

Categories in segment order.

Default []
clusterLabelNexera
(count: number) => string

The accessible name of a cluster. Translate it.

Default (n) => `${String(n)} items`
clusterNexera
boolean | { radius?: number; maxZoom?: number; }

Merge nearby markers into clusters.

Default true

* Required. React Aria props shown are the ones most apps use; the component accepts the rest of its React Aria props too.

Accessible by default.

Built on React Aria, and covered by the WCAG 2.2 evidence generated on every build.

This component relies on the shared primitives' accessibility tests; no criteria are tagged to it directly yet.

Fits any width.

Nexera components respond to the space they are given. Drag the corner of the frame, or pick a width.

0 px · drag the corner

Styling hooks

Pass className to add Tailwind classes (merged last). State is exposed as data attributes, so you can style it with variants like data-pressed:.

Usage
<MapMarkers className="shadow-sm" />

Used in blocks

Related components