Block 116 of 297
Department Directory
Offices sorted A to Z and grouped by letter with a jump index, showing location, phone, email and hours.
- Puck key
- DepartmentDirectoryBlock
- Export
- departmentDirectoryBlock
- React component
- <DepartmentDirectory />
- Path
- components/puck/department-directory-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 A to Z office directory that sorts entries itself, groups them under large letter headings and adds a jump-to-letter row once there is more than one letter. Each office can show a building, phone, email and hours. Offices sit two to a row from tablet width, and on desktop the letter stays pinned beside its group while you scroll.
- A campus "Offices and departments" page that replaces a long static list
- A student services hub where people need phone numbers and room locations quickly
- A college or division page listing its own administrative offices
Writing the content
- Add offices in any order; the list sorts by Name and groups names that start with a number under #.
- Type the Phone the way you want it shown. The tap-to-call link uses only the digits, so (555) 014-2310 still dials correctly.
- Building and room, Email, Hours and Web page all hide when blank; with no Web page the office name is plain text.
Accessibility
- Letter groups are sections labelled by their letter heading, one level below the block heading, with office names one level below that (WCAG 1.3.1).
- Contact details are a description list whose visually hidden terms (Location, Phone, Email, Hours) sit beside decorative icons, so meaning never rests on the icon.
- The jump links are a labelled nav with 44px square targets, and every link shows a focus outline.
Customizing the code
- Letter headings and hover states use Tailwind indigo; replace indigo- to rebrand.
- Change md:grid-cols-2 on each group's list for more or fewer offices per row.
Editor fields
What content editors see in the P1 sidebar when they select this block.
- Headingtext
- Heading levelselect
- Introtextarea
- Departmentsarray