Block 194 of 297
Bell Schedule
Period start and end times with a CSS-only switch between regular, early release and late start days, lunches highlighted.
- Puck key
- BellScheduleBlock
- Export
- bellScheduleBlock
- React component
- <BellSchedule />
- Path
- components/puck/bell-schedule-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
Period start and end times in a table, with up to four schedules behind a segmented switch that works with CSS alone, no JavaScript. Lunch periods are tinted and tagged. It fits school pages where regular, early release and delay days each have different times.
- A high school or middle school bell schedule page
- A families page explaining early release Wednesdays
- A weather-delay page that shows the late start times
Writing the content
- Enter Periods one per line as name | start | end, for example "Period 1 | 7:45 a.m. | 8:40 a.m.". A missing start or end shows a dash.
- Any period with "lunch" in its name is highlighted and tagged automatically, so name lunch rows accordingly and avoid the word elsewhere.
- Schedules takes one to four entries. With only one, the switch disappears and the table shows on its own; the first schedule is always the one selected on load.
Accessibility
- The switch is a set of native radio buttons inside a fieldset with a hidden "Choose a schedule" legend, so it works with arrow keys and shows a focus ring on the selected option (WCAG 2.1.1, 2.4.7).
- Each schedule is a real table with column and row headers and a screen-reader caption naming the schedule and when it applies (WCAG 1.3.1).
- Lunch rows carry a visible "Lunch" text tag in addition to the tint, so they are not identified by color alone (WCAG 1.4.1).
Customizing the code
- Lunch rows use bg-indigo-50/60 and an indigo-100 tag; change those classes or the /lunch/i test in parsePeriods to highlight different rows.
Editor fields
What content editors see in the P1 sidebar when they select this block.
- Headingtext
- Heading levelselect
- Introtextarea
- Schedulesarray
- Lunch notetextarea
- Footnotetextarea