Block 178 of 297
Trail Guide
Trails as cards or rows with distance, difficulty by shape and word, surface, elevation, accessibility, dogs, trailhead and GPX.
- Puck key
- TrailGuideBlock
- Export
- trailGuideBlock
- React component
- <TrailGuide />
- Path
- components/puck/trail-guide-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 trail directory with two layouts: photo cards in a grid of up to three columns, or compact full-width rows that drop the photos to fit more trails. Each trail lists difficulty, distance, elevation gain, route type, surface, dog rules, accessibility notes and trailhead parking, with map and GPX links. An optional legend explains what each difficulty level means.
- A park district trails page covering several parks
- A nature preserve page with two or three featured hikes
- A greenway or rail-trail page with accessibility details
Writing the content
- Pick Cards for a short, photo-led list and Rows for longer lists; Image URL is ignored in Rows.
- Write Distance and Elevation gain the way hikers read them, like "2.4 mi (3.9 km)". A blank Elevation gain is hidden, which suits flat trails.
- Be specific in Accessibility notes: which part is accessible, steepest grade, benches and accessible parking.
- Fill in the three "means…" lines when Difficulty legend is shown, since local trail ratings vary. Up to 24 trails fit.
Accessibility
- Difficulty uses the trail-sign shapes (circle, square, diamond) plus a word and a hidden "Difficulty:" label, never color alone (WCAG 1.4.1).
- Trail facts are a description list with each icon inside its label, so screen readers hear "Distance, 3.1 mi" (WCAG 1.3.1).
- Trail map and GPX file links add the trail name for screen readers, and the GPX link uses the download attribute (WCAG 2.4.4).
Customizing the code
- Difficulty shapes and labels are in the difficulties map and DifficultyIcon; route and dog wording are in routes and dogRules.
- The card grid uses sm:grid-cols-2 lg:grid-cols-3 and photos crop to aspect-3/2.
Editor fields
What content editors see in the P1 sidebar when they select this block.
- Headingtext
- Heading levelselect
- Introtextarea
- Layoutradio
- Difficulty legendradio
- Easy means…text
- Moderate means…text
- Hard means…text
- Trailsarray
- Footnotetextarea
- All trails link texttext
- All trails linktext