title: Annotation
description: <Annotation> anchors any SwiftUI view tree at a map coordinate — chips, badges, photos, custom shapes — whenever the pin needs to look like something other than a stock MapKit <Marker> glyph. Supports a KeywordPoint/Point anchor, a tag for <Map selection>, and an optional title label. iOS 17+; selection requires iOS 18+. <Map> also gains annotationTitles / annotationSubtitles for hiding the MapKit-rendered text labels globally.
<Annotation> anchors any view tree at a map coordinate. Unlike <Marker>,
which is constrained to a pin glyph plus a tint, an annotation renders
arbitrary children — badges, photos, custom shapes, anything you can build
with the views layer. Use it whenever the pin needs to look like something
other than a stock MapKit marker.
iOS 17+. Selection (tag) requires iOS 18+ — the same constraint as
<Marker tag>.
Props
anchor values
KeywordPoint covers the SwiftUI named UnitPoints — handy presets:
For fine-grained placement, pass a Point in [0..1] unit space:
A pin that points down at the coordinate, for example, anchors at
"bottom" (so the pin's bottom edge sits on the spot).
Selection
Annotation taps participate in <Map selection> exactly the same way
tagged markers do — the bound observable receives
{ type: "marker", tag } when the user taps a tagged annotation, and
null when they tap empty map background:
Annotation does not participate in <Map itemSelection> — it has no
MapItem to bind to. If your script uses itemSelection, annotations
render normally but tapping them does not fire the observable.
Map-level title / subtitle visibility
<Map> accepts two props for hiding or forcing the MapKit-rendered text
labels that accompany annotations:
These are MapKit's Visibility enum — "automatic" follows MapKit's
default zoom-dependent behavior. <Annotation> does not carry a subtitle
field itself; annotationSubtitles therefore has no effect on annotation
output, only on items / Apple POIs in the same map.
Custom popover / sheet on tap
The Annotation's content closure is a regular SwiftUI view subtree, so any
view-layer modifier — including popover and the sheet family — attaches
to it directly. There is no dedicated "Annotation card" prop because none
is needed: write the same modifier you would on a normal view.
This is the same pattern SwiftUI itself uses for custom annotation cards —
the popover anchors to the annotation's content view automatically. Apple's
itemDetailSelectionAccessory / featureSelectionAccessory are only for
Marker(item:) and Apple-rendered POIs; <Annotation> rolls its own card
via this view-layer modifier path.
When to choose <Annotation> vs <Marker>
<Marker>— the visual is a stock MapKit pin: tint, optional SF Symbol glyph or monogram, optional auto POI glyph fromMapItem. Use for "ordinary pins" andMapItem-based annotations.<Annotation>— the visual is your own SwiftUI subtree. Use when you need a chip, a photo callout, a stretched ribbon, or anything else that isn't a Marker glyph.
The two coexist freely inside the same <Map> and share the same
<Map selection> / tag mechanism.
