Skip to content

Block 196 of 297

District Calendar

Key school-year dates by month with text type badges for breaks and early release, plus iCal subscribe and PDF links.

Puck key
DistrictCalendarBlock
Export
districtCalendarBlock
React component
<DistrictCalendar />
Path
components/puck/district-calendar-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

Key school-year dates laid out by month in a three-column grid, with each date tagged by type, plus buttons to subscribe to the calendar feed and download a PDF. It covers the dates families plan around rather than every event. Months stack to two columns on tablets and one on phones.

  • The district's official school-year calendar page
  • A new-family guide listing first days and breaks
  • A school site sidebar page linking to the printable calendar
Writing the content
  • Enter Dates one per line as date | what happens | type, for example "Nov 25–27 | Thanksgiving break | Break". A line with no pipes shows as an event with the date "TBA".
  • The type sets the badge style by keyword: no school, closed, holiday, break or recess; first, last or graduation; early, late or half; conference, meeting or open house. Anything else gets a plain gray badge.
  • Point Subscribe link at a webcal:// or .ics feed, and fill PDF details with the file type and size so families know what they are downloading.
Accessibility
  • Every badge prints its type in words, with a hidden "Type:" prefix for screen readers, so the color is never the only cue (WCAG 1.4.1).
  • Month names are headings one level below the Heading level setting, which makes the year navigable by heading (WCAG 1.3.1).
  • The subscribe and PDF links are 44px tall with an indigo focus outline, and the PDF icon's hover motion is limited to visitors without a reduced-motion preference.
Customizing the code
  • Edit the regular expressions in badgeClass to add keywords or change which badge style a type receives.

Editor fields

What content editors see in the P1 sidebar when they select this block.

  • Headingtext
  • Heading levelselect
  • Introtextarea
  • Monthsarray
  • Subscribe link texttext
  • Subscribe linktext
  • PDF link texttext
  • PDF linktext
  • PDF detailstext
  • Footnotetextarea