Map Marker You
- Stable
- WCAG 2.2 evidence
- RTL
Where the user is on a map: a blue dot with a translucent accuracy circle. The map is not part
of the library: position the marker yourself, centred on the coordinates (translate(-50%, -50%)), and size the accuracy
circle with className (for example size-24) if you know the accuracy. It is a shape and a name, never a control: exposed as an image named label ("Your location"), so the marker's meaning does not
depend on its colour (WCAG 1.1.1, 1.4.1), or hidden with isDecorative when the location is stated in text. Presentational:
renders in React Server Components. Consumer duties: show a user's position only with their consent, and give the same
information as text next to the map (an address or "Near Gulberg III") for people who cannot see the map.
import { MapMarkerYou } from "@nexera-ui/react";- 5
- examples
- 3
- props
- 2
- live controls
- 1
- platform
- 5
- WCAG criteria
- 0
- 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.
import { MapMarkerYou } from "@nexera-ui/react";
<MapMarkerYou />Examples 4
The same examples as Storybook, rendered live. Open Code to copy one.
On map surfaces
On a map surface (the map-* tokens, light and dark): the 3 px surface stroke keeps the dot readable on land, water and parks.
import { MapMarkerYou } from "@nexera-ui/react";
export function OnMapSurfaces() {
return (
<div className="flex flex-wrap gap-4">
{["bg-map-land", "bg-map-water", "bg-map-park", "bg-map-building"].map((surface) => (
<div
key={surface}
className={`flex size-28 items-center justify-center rounded-md ${surface}`}
>
<MapMarkerYou />
</div>
))}
</div>
);
}
Large accuracy
A larger accuracy circle: size the marker with className; the dot keeps its 18 px.
import { MapMarkerYou } from "@nexera-ui/react";
export function LargeAccuracy() {
return (
<div className="bg-map-land flex size-48 items-center justify-center rounded-md">
<MapMarkerYou className="size-40" label="Your location, accurate to 200 metres" />
</div>
);
}
Decorative
Decorative: when the position is written as text next to the map, hide the marker.
import { MapMarkerYou } from "@nexera-ui/react";
export function Decorative() {
return (
<p className="text-body-default text-primary m-0 flex items-center gap-2">
<MapMarkerYou isDecorative className="size-8" />
You are near Gulberg III, Lahore.
</p>
);
}
Right to left
Right-to-left: the marker is symmetric, so nothing changes.
import { MapMarkerYou } from "@nexera-ui/react";
export function RightToLeft() {
return (
<div dir="rtl" lang="ar" className="flex items-center gap-3">
<MapMarkerYou label="موقعك" />
<span className="text-body-default text-primary">أنت بالقرب من غولبرغ</span>
</div>
);
}
Props 3
Press "Try it" on a card to load that prop into the playground.
3 props shown
classNameNexerastringExtra classes, merged last so they win over the defaults (for example a different size-* for the accuracy circle).
labelNexerastringText alternative (WCAG 1.1.1). The marker has no text of its own and is drawn in one blue, so this is what tells assistive technology what it is. Translate it. Not allowed on a decorative marker.
isDecorativeNexerabooleanHide the marker from assistive technology.
Hide the marker (aria-hidden), because the user's location is stated as text next to the map.
* 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
3 direct · 2 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
- 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.
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:.
<MapMarkerYou className="shadow-sm" />Used in blocks
No block uses MapMarkerYou yet.
Related components
- AccordionItemOne collapsible section of an FAQ or settings page.
- AreaChartA stacked area chart: layers piled up over time with the title, range switch, actions and legend of the card.
- AvailabilityRowOne person's availability across a window of the day: an avatar with initials and the name, and a timeline with the busy periods drawn as bars.
- AvatarA person or organisation shown as a photo, initials or an icon.
- AvatarGroupA row of overlapping avatars with a "+N" chip for the rest.
- AvatarLabelAn avatar with a name and an optional subtitle beside it, for a person in a list, a header or a mention.
- BadgeShort status or category label: `Tone` x `Variant` x `Size`, with an optional dot, leading icon and remove button.
- BadgeGroupA pill that pairs a small badge with a short message, for an announcement or a status line.