Skip to content

Block 04 of 297

Search Hero

Portal front door with one large GET search box and popular-search links, built for city and campus sites.

Puck key
HeroSearchBlock
Export
heroSearchBlock
React component
<HeroSearch />
Path
components/puck/hero-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 dark indigo hero built around one large site search box, with a heading and short intro above and a row of popular-search links below. The form submits with GET to your own search page, so it needs no JavaScript. It suits city, county and campus portals where most visitors arrive with a task in mind.

  • A city or county home page that routes residents to services
  • A help center or knowledge base front page
  • A campus or district portal with many departments
Writing the content
  • Set Search page URL and Search parameter name to match your results page, for example /search and q for /search?q=permits. A mismatch returns an empty results page.
  • Write the Search field label as a full phrase like "Search city services"; it is read aloud but not shown.
  • List up to eight Popular searches, ordered by real demand; five or six usually fit on two lines.
  • Popular search links can point straight to a page or to a canned search URL.
Accessibility
  • The form has role="search" and a real label tied to the input, so it is announced as a search landmark with a name (WCAG 1.3.1, 4.1.2).
  • Popular links sit in a nav element named by the Popular searches label, and each link is at least 44px tall.
  • The input shows an indigo focus ring and the button a focus outline; the decorative wave lines are aria-hidden.
Customizing the code
  • The background is bg-indigo-950 with indigo-400/15 contour lines in the inline SVG; change both to rebrand.
  • The input is marked required, so empty searches won't submit; remove required if your search page handles blank queries.

Editor fields

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

  • Eyebrowtext
  • Headingtextarea
  • Heading levelselect
  • Bodytextarea
  • Search page URLtext
  • Search parameter nametext
  • Search field labeltext
  • Placeholdertext
  • Button texttext
  • Popular searches labeltext
  • Popular searchesarray