Block 161 of 297
Road Closures
Current road closures and detours with cross streets, dates, reason and a labeled severity.
- Puck key
- RoadClosuresBlock
- Export
- roadClosuresBlock
- React component
- <RoadClosures />
- Path
- components/puck/road-closures-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 list of current road closures and detours, each card showing a severity pill, the street, cross streets, when, why and a separate detour box. A summary bar above the list counts streets by severity next to a last-updated line. On wider screens the detour sits to the right of the details; on phones it stacks beneath them.
- A public works page of planned closures for the month
- Event-day street closure notices for a festival or race
- A construction season page linked from road signs or text alerts
Writing the content
- Change Last updated every time you edit a closure, with the date and time, so drivers know the list is current.
- Pick a Severity for every item; the summary bar counts them, so remove Reopened items after a few days.
- Write Detour as plain driving directions. Leave it blank and the detour box disappears.
- Use Between for the cross streets only, like "3rd Avenue and 5th Avenue"; the block adds the word "Between" itself. Up to 30 closures fit.
Accessibility
- Severity shows an icon and a word (Road closed, Lanes closed, Expect delays, Reopened) with a hidden "Status:" prefix; the colored left rail is decoration (WCAG 1.4.1).
- Each street name is a heading below the section heading, and When and Why are a description list (WCAG 1.3.1).
Customizing the code
- Pill colors, rail colors, icons and wording per severity are in the severities map; order sets the summary sequence.
- The two-part card layout comes from md:grid-cols-5 with md:col-span-3 and md:col-span-2; adjust these to give the detour more room.
Editor fields
What content editors see in the P1 sidebar when they select this block.
- Headingtext
- Heading levelselect
- Introtextarea
- Last updatedtext
- Closuresarray
- Map link texttext
- Map linktext
- Alerts link texttext
- Alerts linktext