Skip to content

Block 195 of 297

Lunch Menu

A week of school lunches by day with sides, vegetarian options and allergen badges, plus a free meals application link.

Puck key
LunchMenuBlock
Export
lunchMenuBlock
React component
<LunchMenu />
Path
components/puck/lunch-menu-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 week of school lunches as day cards, each listing the main dish, sides, a vegetarian option and allergen tags, followed by an allergy note and a meal benefits card with an application link. Five cards sit in one row on desktop, two per row on tablets and one on phones. Use it where families check the menu every week.

  • A nutrition services page that is updated each week
  • An elementary school home page section showing this week's lunches
  • A back-to-school page that promotes the free and reduced-price meal application
Writing the content
  • Days takes one to seven entries, but the desktop grid has five columns, so a Saturday or summer-program day wraps to a second row.
  • Type Sides and Allergens as comma-separated lists; the block splits them into a bulleted list and individual "Contains:" tags.
  • Update the Week field each time you change the menu. The meal help card hides when Meal help heading, text and link text are all blank.
Accessibility
  • Allergens are written out as text tags after a "Contains:" label, and the vegetarian option is labeled in words, so neither depends on color or an icon (WCAG 1.4.1).
  • Each day name and date form a heading one level below the Heading level setting, letting screen reader users jump between days (WCAG 1.3.1).
  • Links are at least 44px tall with visible focus outlines, and their arrow nudge on hover only runs when the visitor has not asked for reduced motion.
Customizing the code
  • Change lg:grid-cols-5 on the day list if your menu covers a different number of days.

Editor fields

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

  • Headingtext
  • Heading levelselect
  • Introtextarea
  • Weektext
  • Daysarray
  • Allergy notetextarea
  • Meal help headingtext
  • Meal help texttextarea
  • Application link texttext
  • Application linktext
  • Nutrition link texttext
  • Nutrition linktext