Skip to content

Block 200 of 297

Staff Directory

Staff grouped by department and sorted by last name, with roles, email and tap-to-call extensions, plus department jump links.

Puck key
StaffDirectoryBlock
Export
staffDirectoryBlock
React component
<StaffDirectory />
Path
components/puck/staff-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

A staff directory grouped by department, with each person's name, role, email and phone extension on one row. Names are sorted by last name automatically, and pill links at the top jump to each department. Extensions become tap-to-call links that dial the main number first. On phones each row stacks name above contact links.

  • A school's "Contact our staff" page
  • A district office directory organized by department
  • A counseling or student services team page
Writing the content
  • Enter Staff one person per line as name | role | email | extension. Any field after the name can be left empty, and a leading "ext." on the extension is stripped.
  • Sorting uses the last word of the name, ignoring anything after a comma, so write suffixes as "Robert Hale, Jr." to sort under Hale.
  • Fill in Main phone number to make extensions dialable; without it they show as plain text.
  • Departments takes up to 20 groups. The jump links only appear when two or more departments have staff listed.
Accessibility
  • Department names are headings one level below the Heading level setting, and the jump links sit in a navigation landmark labeled "Jump to a department" (WCAG 1.3.1).
  • Extension links add the person's name for screen readers, such as "ext. 2101, call Samantha Lee", so a column of extensions is not ambiguous.
  • Email and phone links are at least 44px tall with visible indigo focus outlines (WCAG 2.4.7).
Customizing the code
  • The lastName and parseStaff functions control sorting; remove the .sort() call in parseStaff to keep the order you typed.

Editor fields

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

  • Headingtext
  • Heading levelselect
  • Introtextarea
  • Main phone numbertext
  • Departmentsarray
  • Footnotetextarea