Map
Provider-agnostic interactive map embed with responsive aspect ratio, accompanying address block, and external "view on map" link. Wraps any <iframe> (Google Maps, OpenStreetMap, Mapbox, etc.) in a consistent container with a lazy-loaded placeholder and semantic address markup for users who cannot interact with the embed.
Usage
When to use
- Showing the location of a physical venue, office, or landmark inside content
- Any "find us" block that combines a map, an address, and an external link
- When the consumer wants a consistent responsive aspect ratio around a third-party map embed
When not to use
- For interactive mapping experiences with custom layers, markers, and state - use a dedicated mapping library directly
- For a list of multiple locations - render multiple map components or use a dedicated listing pattern
- For driving directions - link out to an external mapping service
Do
- Provide a descriptive
titleon the iframe - Include a plain-text address alongside the visual map so users who cannot interact with the embed still get the location
- Link out to the full external map for users who need richer interaction
Don't
- Rely on the map iframe alone to convey the address
- Auto-play location or geolocation without user consent
API
Slots
| Slot | Required | Description |
|---|---|---|
address | - | Plain-text address displayed alongside the map. |
link | - | External link object with url, text, and optional is_external keys. |
Props
| Prop | Type | Default | Description |
|---|---|---|---|
src | string | - | Embed URL for the map provider. |
title | string | Embedded map | Accessible title for the embed. |
classes | array | - | Additional CSS class words merged into the root element. |
attributes | object | - | Additional HTML attributes spread on the root element. |
Classes
| Class | Capability | Default | Description |
|---|---|---|---|
.sm | Size | - | Small. |
.md | Size | Yes | Medium. |
.lg | Size | - | Large. |
.flat | Elevation | Yes | No elevation. |
.raised | Elevation | - | Slight elevation. |
Examples
Address only
Address block without an embed (map fails or is suppressed).
Loading
Skeleton placeholder shown before the iframe loads.
Accessibility
- WCAG 2.2 AA
- The
<iframe>has a descriptivetitleattribute so screen readers announce the embed. - The address is rendered inside an
<address>element for semantic markup. - A text address is always present alongside the visual map so screen reader users can access the location without interacting with the iframe.
- The external link has descriptive text (e.g. "View on Google Maps") - not just "click here".
Related
- loading - placeholder/shell shown before load