Skip to content

Block 203 of 297

Catalog Search

A catalog search panel that submits to your catalog with an optional format filter, quick links and an Ask a librarian link.

Puck key
CatalogSearchBlock
Export
catalogSearchBlock
React component
<CatalogSearch />
Path
components/puck/catalog-search-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 catalog search card with a keyword box, an optional format menu and a search button, sending visitors straight to your library catalog's results page. Shortcut pills and an "Ask a librarian" link sit below a divider. On phones the format menu drops under the search box and the button stretches full width.

  • The top of a public library home page
  • A "Find a book" or research help page
  • A branch page that sends visitors into the shared catalog
Writing the content
  • Set Catalog search URL and Search parameter name together. Run a search in your catalog and copy the results address; the parameter is usually the name before the = sign holding your words, such as q or lookfor.
  • The format menu only appears when Format parameter name is filled and at least one format has both a Label and a Catalog value that matches your catalog exactly.
  • Write Search field label as what people can search for, like "Title, author, subject or keyword"; the Placeholder is only an example.
Accessibility
  • The form has role="search" with an accessible name taken from the heading, so it appears as a search landmark (WCAG 1.3.1).
  • Both the keyword box and the format menu have visible labels tied to their inputs, so the placeholder is never the only description.
  • The input, menu and button are at least 48px tall, links at least 44px, and every control shows a visible indigo focus ring (WCAG 2.4.7).
Customizing the code
  • The decorative bookshelf in the corner is an inline SVG using text-indigo-100; delete it or change its color class.

Editor fields

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

  • Eyebrowtext
  • Headingtext
  • Heading levelselect
  • Introtextarea
  • Catalog search URLtext
  • Search parameter nametext
  • Search field labeltext
  • Placeholdertext
  • Format parameter nametext
  • Format menu labeltext
  • Formatsarray
  • Button texttext
  • Quick links labeltext
  • Quick linksarray
  • Help prompttext
  • Help link texttext
  • Help linktext