Block 171 of 297
Park Map Legend
A park map with numbered markers placed by percentage, a matching accessible legend, and a PDF download link.
- Puck key
- ParkMapLegendBlock
- Export
- parkMapLegendBlock
- React component
- <ParkMapLegend />
- Path
- components/puck/park-map-legend-block.tsx
- Dependencies
- None
- License
- MIT
About this block
When to use it, how to write for it, and what to change in the code.
What it's for
A park map image with up to 12 numbered markers placed by percentage, next to a matching numbered key. The key is the main content; markers are a pointer shortcut that jump to their entry in the key and highlight it, or open the spot's Link when one is set. On large screens the map sits beside the key; on phones the key follows it.
- A single park page showing parking, shelters and restrooms
- A campus or community center wayfinding map
- An event site map for a festival or race
Writing the content
- Set Across (%) and Down (%) from 0 to 100, measured from the map's top-left corner. Leave Across blank to list a spot in the key without a marker.
- Keep Map description short, like "Map of Willow Creek Park"; the numbered key below carries the detail.
- The download button needs both Download link text and Download link. Add File details like "PDF, 1.2 MB" so people know the size.
Accessibility
- Map markers are hidden from screen readers and removed from the tab order; the numbered key is an ordered list with the same information as text (WCAG 1.1.1, 1.3.1).
- The marker hover enlargement only runs when the visitor has not asked for reduced motion (motion-safe).
Customizing the code
- Marker size and color are set on the absolute-positioned anchors (size-7 sm:size-8, bg-indigo-700); the key highlights the targeted entry with target:bg-indigo-50.
- The 12-marker cap is set both in the array field max and the .slice(0, 12) in render; change both together.
Editor fields
What content editors see in the P1 sidebar when they select this block.
- Headingtext
- Heading levelselect
- Introtextarea
- Map image URLtext
- Map descriptiontext
- Legend headingtext
- Markersarray
- Download link texttext
- Download linktext
- File detailstext