Block 125 of 297
Library Hours
Opening hours for several library locations in one table, with a today note, holiday changes and contact links.
- Puck key
- LibraryHoursBlock
- Export
- libraryHoursBlock
- React component
- <LibraryHours />
- Path
- components/puck/library-hours-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
An hours table for several library locations, with up to four day-group columns such as Mon–Thu, Friday, Saturday and Sunday. A period label and a one-line today notice sit above it, and holiday changes and contact links follow below. On narrow screens the table scrolls sideways rather than squeezing, and the contact card drops beneath the holiday list.
- A main library hours page covering branch and specialty libraries
- A semester hours update that also lists break closures
- A student services page where hours for several desks share one schedule
Writing the content
- Fill Column 1 days through Column 3 days with your day groups (defaults: Mon–Thu, Friday, Saturday). Leave Column 4 days blank to drop that column.
- Type Closed in an hours cell to show it in muted italics; an empty cell shows a dash.
- Keep the Today note to one short line, and clear it once it is out of date.
- Add up to 10 Holiday and break changes. Give each a Start date (YYYY-MM-DD) so it carries a machine-readable date.
Accessibility
- Hours are a real table with column headers, the location as a row header and a visually hidden caption from the Table caption field (WCAG 1.3.1).
- The scroll wrapper is a focusable, labelled region, so keyboard users can scroll the table and see a focus outline (WCAG 2.1.1).
- The pulsing dot beside the today note is decorative and only animates under motion-safe, so it stays still for visitors who reduce motion.
Customizing the code
- The header row is bg-neutral-950 and accents are Tailwind indigo; change both to match your palette.
Editor fields
What content editors see in the P1 sidebar when they select this block.
- Headingtext
- Heading levelselect
- Introtextarea
- Periodtext
- Today notetext
- Table captiontext
- Column 1 daystext
- Column 2 daystext
- Column 3 daystext
- Column 4 daystext
- Locationsarray
- Holiday changes headingtext
- Holiday and break changesarray
- Phonetext
- Emailtext
- Chat link texttext
- Chat linktext