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

MapMarkerPerson

  • Stable
  • WCAG 2.2 evidence
  • RTL

A person on a map: a ring and avatar with the person's initials, a work status dot and a pointer. Selected, it grows, gets a halo and shows the name. The map is not part of the library: position the marker yourself with translate(-50%, -100%) so the pointer tip sits on the coordinates. It is plain (an image named "Ayesha Khan, Working") unless you give it onPress (a button) or href (a link). Interactive markers are React Aria buttons and links: Enter and Space press, keyboard focus draws the focus ring around the ring, hover is data-hovered (WCAG 2.1.1, 2.4.7, 4.1.2). The selected marker has aria-current. What the marker is, a person, is given by the initials and the name, and the work status by the name's text: colour never carries it alone (1.4.1). Consumer duties: show a person's location only with consent; show the status as visible text somewhere sighted users can reach it (a card or list), because the dot colours alone do not satisfy 1.4.1; keep neighbouring markers 24 px apart or large enough (2.5.8).

import { MapMarkerPerson } from "@nexera-ui/react";
Loading example…
8
examples
14
props
3
live controls
1
platform
8
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…
workStatus
isSelected
isDisabled
Generated code
import { MapMarkerPerson } from "@nexera-ui/react";

<MapMarkerPerson />

Examples 7

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

With visible status

Consumer duty (WCAG 1.4.1): the dot colours alone do not tell the status, so the statuses are also written as text next to the markers (here a list). The markers' names include the status for assistive technology.

Loading example…

Long name

A long name wraps inside the selected marker's label (up to 140 px wide) instead of stretching the marker.

Loading example…

Right to left

Right-to-left: the status dot moves to the bottom-left corner of the ring; the map itself is not mirrored.

Loading example…

Narrow width

Narrow container (320 px): markers are small; a wrapping row keeps them in view.

Loading example…

Disabled

Disabled: dimmed, out of the tab order.

Loading example…

On a map

All four markers on a consumer-built map (the map-* tokens, light and dark): people (a button each; the selected one has a halo and its name), a place, a cluster and the user's own position. The map is not part of the library: the consumer positions each marker, here with translate(-50%, -100%) for pins and translate(-50%, -50%) for round markers. A map is not mirrored in right-to-left layouts, so the offsets are physical.

Loading example…

Full team map

Loading example…

Props 14

Press "Try it" on a card to load that prop into the playground.

14 props shown

name*Nexera
string

The person's name. It is the marker's accessible name, together with the work status (WCAG 1.1.1, 4.1.2), and the visible label when the marker is selected.

Default –
initialsNexera
string

One or two letters shown in the avatar. Decorative: the name carries the person.

Default the first letters of the first and last word of `name`
workStatusNexera
"working" | "remote" | "on-leave" | "offline"

Work status: the colour of the dot on the avatar. working is green, remote cyan, on-leave violet, offline grey. The status is part of the accessible name as text.

Default working
workStatusLabelNexera
string

Text for the work status in the accessible name, for example "Im Homeoffice". Translate it.

Default the English name: "Working", "Remote", "On leave" or "Offline"
isSelectedNexera
boolean

Whether the person is the selected marker: a larger pin with a halo and the name label, and aria-current for assistive technology. Hover (State=Hover) is a pointer state that React Aria drives.

Default false
idNexera
string

DOM id.

Default –
aria-describedbyNexera
string

Id(s) of the element(s) that describe the marker (for example a card with the person's role and place).

Default –
classNameNexera
string

Extra classes, merged last so they win over the defaults.

Default –
styleNexera
CSSProperties

Inline style (typically the position on the map).

Default –
onPressNexera
((event: PressEvent) => void) | ((event: PressEvent) => void)

Called when the marker is pressed (pointer, Enter or Space). Makes the marker a button. Also called when the link is pressed.

Default –
hrefNexera
string

Makes the marker a link to this URL.

Default –
targetNexera
string

Link target.

Default –
relNexera
string

Link relationship.

Default –
isDisabledNexera
boolean

Disables the button. Disables the link.

Default false false

* 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.

WCAG 2.2 evidence

5 direct · 3 supporting
  • 1.1.1Non-text ContentLevel A · tested directly
  • 1.3.2Meaningful SequenceLevel A · supporting test
  • 1.4.1Use of ColorLevel A · tested directly
  • 1.4.11Non-text ContrastLevel AA · supporting test
  • 1.4.12Text SpacingLevel AA · supporting test
  • 2.1.1KeyboardLevel A · tested directly
  • 2.4.7Focus VisibleLevel AA · tested directly
  • 4.1.2Name, Role, ValueLevel A · tested directly

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:.

  • data-disabled
Usage
<MapMarkerPerson className="data-disabled:opacity-90 shadow-sm" />

Used in blocks

Related components