Skip to content

Block 211 of 297

Reading Challenge

A summer reading challenge with dates, tracks by age, how-it-works steps, prizes and an accessible community progress bar.

Puck key
ReadingChallengeBlock
Export
readingChallengeBlock
React component
<ReadingChallenge />
Path
components/puck/reading-challenge-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 summer reading program section that opens on a dark indigo band with the heading, dates, sign-up button and a community progress panel. Below it, a raised card lists tracks by age, followed by numbered how-it-works steps beside a prizes box. Tracks run four across on desktop and two on tablets; everything stacks on phones.

  • The library's summer reading landing page
  • A winter or community-wide reading challenge
  • A home page feature during the program, showing progress toward the goal
Writing the content
  • The progress panel only appears when Progress label is filled and both Progress so far and Goal are numbers, with Goal above zero. Commas are fine.
  • Update Progress so far on a set schedule and say so in Progress note, along with where the figure comes from.
  • Tracks by age takes up to six, though four fill one desktop row. Put the age range in Ages; it shows as a badge above the track name.
Accessibility
  • The bar is a progressbar with min, max and current values and an aria-valuetext such as "1,200,000 of 2,000,000 minutes, 60%". The same figures are printed as text above and below it.
  • Section headings for tracks, steps and prizes step down from the Heading level setting; track names and step titles are plain text inside lists rather than headings (WCAG 1.3.1).
  • The sign-up button is 48px tall and uses a white focus outline that stays visible on the dark band (WCAG 2.4.7).
Customizing the code
  • The top band is bg-indigo-950 with decorative indigo-800 circles in an inline SVG; change or remove that SVG for a different backdrop.

Editor fields

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

  • Eyebrowtext
  • Headingtext
  • Heading levelselect
  • Introtextarea
  • Datestext
  • Sign-up button texttext
  • Sign-up linktext
  • Progress labeltext
  • Progress so fartext
  • Goaltext
  • Unittext
  • Progress notetext
  • Tracks headingtext
  • Tracks by agearray
  • Steps headingtext
  • How it worksarray
  • Prizes headingtext
  • Prizesarray