Component Contract
Search
Site search input and results layout for finding pension plan resources across the CAAT member experience.
Live Demo
Search Input
Rendered
Search with Suggestions
Rendered
Search Results Page
Rendered
12 results for “pension benefits”
Understanding Your CAAT Pension Benefits
caat.ca › members › benefits › overview
Learn about your pension benefits as a CAAT member, including defined benefit plan details, survivor benefits, and inflation protection.
Retirement Planning & Pension Estimates
caat.ca › blog › retirement-planning
Use our pension calculator to estimate your pension benefits at retirement. See how your years of service and salary affect your monthly income.
DBplus Plan Member Handbook
caat.ca › documents › dbplus-handbook.pdf
A comprehensive guide to your pension benefits, including contribution rates, retirement options, and survivor protections under the DBplus plan.
Survivor and Death Benefits
caat.ca › members › benefits › survivor
Your CAAT pension benefits include important protections for your loved ones. Learn about survivor pensions, lump-sum options, and beneficiary designations.
No Results State
Rendered
No results found for “xyz”
Try different keywords or check the spelling of your search term.
Helpful links
States
Follows the Interaction States matrix. The input implements default and focus; suggestions and result filters implement default, hover, focus, and selected. The static is-* classes mirror the live pseudo-class states.
Input
Result filters
Code sample
HTML
<!-- Search input -->
<form class="caat-search" role="search" aria-label="Site search">
<i class="bi bi-search caat-search__icon" aria-hidden="true"></i>
<input type="search" class="form-control caat-search__input"
placeholder="Search CAAT resources..."
aria-label="Search CAAT resources">
<button type="button" class="caat-search__clear"
aria-label="Clear search">
<i class="bi bi-x-lg" aria-hidden="true"></i>
</button>
</form>
<!-- Results -->
<div class="caat-search-results">
<p class="caat-search-results__count">12 results for "pension benefits"</p>
<div class="caat-search-results__item">
<h4 class="caat-search-results__title"><a href="#">Result Title</a></h4>
<p class="caat-search-results__url">caat.ca › section</p>
<p class="caat-search-results__excerpt">Excerpt with <mark>highlighted term</mark>.</p>
<div class="caat-search-results__meta">
<span class="badge bg-light text-dark">Category</span>
</div>
</div>
</div>
1. Summary
| Component | Search |
| AEM Resource Type | caat/components/search |
| Purpose | Provides site search input and results display for finding pension plan resources across the CAAT member experience. |
| Variants | Search input · Search with suggestions · Results page · No results state |
| Contains | Search input, icon, clear button, suggestion dropdown, results list, no-results message |
| Used in | Global header, search results page, knowledge base, member portal |
| Figma | CAAT DS / Components / Search |
| Status | Rebuild |
2. Design Tokens
| Token | Role | Value (light) |
|---|---|---|
--caat-blue-900 | Result title hover colour | #003750 |
--caat-blue-700 | Result title link colour | #0b5a80 |
--caat-blue-100 | Search term highlight (<mark>) background | #e7f4fb |
--caat-green | Result URL breadcrumb colour | #55a546 |
--caat-grey-200 | Input border, dividers | #dfe6ef |
--caat-focus | Focus ring on input and interactive elements | #4D90FE |
--caat-ink | Primary text colour | #102637 |
--caat-radius | Border-radius for input and dropdown | .75rem |
--caat-font-primary | Font family | Libre Franklin |
3. Authoring Fields
| Field | Type | Required | Notes |
|---|---|---|---|
| Placeholder text | Text | No | Default: "Search CAAT resources…" |
| Accessible label | Text | Yes | Populates aria-label on the search input. |
| Search endpoint | URL | Yes | API endpoint for search queries. |
| Enable suggestions | Toggle | No | Enables typeahead suggestion dropdown. |
| Suggestion endpoint | URL | Conditional | Required when suggestions enabled. Returns suggestion JSON. |
| Results per page | Number | No | Default: 10. Controls pagination of results. |
| No-results message | Text | No | Default: "No results found for…" |
| Helpful links | Multifield | No | Links shown in the no-results state. Each: label (text) + URL. |
4. Validation
| Rule | Error message |
|---|---|
| Accessible label is required. | "Provide an accessible label for the search input." |
| Search endpoint is required. | "Enter a valid search endpoint URL." |
| Suggestion endpoint required when suggestions enabled. | "Provide a suggestion endpoint URL." |
| Results per page must be between 1 and 50. | "Enter a value between 1 and 50." |
| Helpful links must have both label and URL. | "Each helpful link requires a label and URL." |
5. Content Guidance
- Placeholder text should guide users: "Search CAAT resources…" or "Search for pension information…".
- Keep suggestion terms concise — ideally 2 – 4 words matching common member queries.
- Result excerpts should be 1 – 2 sentences long, with the search term highlighted using
<mark>. - URL breadcrumbs should reflect the page hierarchy, not the full URL.
- No-results state should always include helpful links to guide users to relevant content.
- Category tags on results help members identify content type at a glance.
6. Semantic HTML
Search input
<form class="caat-search" role="search" aria-label="Site search">
<i class="bi bi-search caat-search__icon" aria-hidden="true"></i>
<input type="search"
class="form-control caat-search__input"
placeholder="Search CAAT resources..."
aria-label="Search CAAT resources">
<button type="button" class="caat-search__clear"
aria-label="Clear search">
<i class="bi bi-x-lg" aria-hidden="true"></i>
</button>
</form>
Search results
<div class="caat-search-results">
<p class="caat-search-results__count">
12 results for “pension benefits”
</p>
<div class="caat-search-results__item">
<h4 class="caat-search-results__title">
<a href="/page-url">Page Title</a>
</h4>
<p class="caat-search-results__url">
caat.ca › section › page
</p>
<p class="caat-search-results__excerpt">
Excerpt with <mark>highlighted term</mark>.
</p>
<div class="caat-search-results__meta">
<span class="badge bg-light text-dark">Category</span>
</div>
</div>
</div>
Suggestions dropdown
<ul class="caat-search__suggestions" id="search-suggestions"
role="listbox">
<li class="caat-search__suggestion" role="option">
<i class="bi bi-search" aria-hidden="true"></i>
pension calculator
</li>
</ul>
7. CSS Contract
| Selector | Purpose |
|---|---|
.caat-search | Search form wrapper. Relative positioning for icon/clear button. |
.caat-search__input | Large search input (3.5rem height). Left padding for icon, right padding for clear button. |
.caat-search__icon | Magnifying glass icon positioned absolutely left. |
.caat-search__clear | Clear/reset button positioned absolutely right. |
.caat-search__suggestions | Typeahead dropdown. White background, shadow, rounded bottom corners. |
.caat-search__suggestion | Individual suggestion item. Hover background uses --caat-blue-100. |
.caat-search-results | Results list container. |
.caat-search-results__count | Results count line with bottom border. |
.caat-search-results__item | Individual result. Bottom border divider. |
.caat-search-results__title | Result title. Link colour --caat-blue-700. |
.caat-search-results__url | URL breadcrumb in small green text (--caat-green). |
.caat-search-results__excerpt | Result excerpt text. <mark> uses --caat-blue-100 background. |
.caat-search-results__meta | Metadata row for category tags. |
8. Accessibility
| Requirement | Implementation |
|---|---|
| Landmark | role="search" on the <form> element. |
| Label | aria-label on both the form and the input. |
| Clear button | aria-label="Clear search" on the clear/reset button. |
| Suggestions | role="listbox" on suggestions list, role="option" on each item. aria-expanded and aria-controls on input. |
| Keyboard | Arrow keys navigate suggestions. Enter selects. Escape closes dropdown. |
| Focus | Visible :focus-visible ring on input, clear button, and suggestion items. |
| Results | Result count announced via aria-live="polite" region after search. |
| Highlight | <mark> element used for search term highlighting — semantically meaningful. |
| Colour contrast | All text and interactive elements meet WCAG 2.1 AA (4.5:1 text, 3:1 non-text). |
9. SEO
Transient / structural UI with no indexable content of its own — no SEO markup required. Ensure any content this component wraps or reveals stays server-rendered and crawlable.
10. Analytics
Analytics are captured through the shared data-analytics-component attribute on the component root (emitted automatically) and reported to the central data layer. Event names and payloads follow the organisation's standard analytics schema — defined centrally with the analytics team, not invented per component — so no bespoke tracking is specified here.
11. AEM Notes
- Resource type:
caat/components/search - Sling Model:
SearchModel— exposesquery,results[],totalResults,suggestions[],helpfulLinks[]. - HTL template:
search.html— usesdata-sly-testto switch between results, no-results, and initial states. - Client library:
caat.components.search— CSS + JS. JS handles typeahead debounce, keyboard navigation, and analytics events. - Policy: Authors can configure search endpoint, enable/disable suggestions, and set results-per-page via template policy.
- Allowed parents: Layout Container, Header, Experience Fragment.
- Search service: Integrates with AEM QueryBuilder or external search API (e.g. Azure Cognitive Search). Endpoint configured in OSGi.
12. Dialog Model
Simplified model — shows field intent and Granite UI resource types, not the literal cq:dialog node tree (e.g. select options are authored as child items nodes).
{
"jcr:primaryType": "nt:unstructured",
"sling:resourceType": "cq/gui/components/authoring/dialog",
"tabs": {
"properties": {
"placeholderText": {
"sling:resourceType": "granite/ui/components/coral/foundation/form/textfield",
"label": "Placeholder text",
"name": "./placeholderText"
},
"accessibleLabel": {
"sling:resourceType": "granite/ui/components/coral/foundation/form/textfield",
"label": "Accessible label",
"name": "./accessibleLabel",
"required": true
},
"searchEndpoint": {
"sling:resourceType": "granite/ui/components/coral/foundation/form/textfield",
"label": "Search endpoint",
"name": "./searchEndpoint",
"required": true
},
"enableSuggestions": {
"sling:resourceType": "granite/ui/components/coral/foundation/form/checkbox",
"label": "Enable suggestions",
"name": "./enableSuggestions"
},
"suggestionEndpoint": {
"sling:resourceType": "granite/ui/components/coral/foundation/form/textfield",
"label": "Suggestion endpoint",
"name": "./suggestionEndpoint"
},
"resultsPerPage": {
"sling:resourceType": "granite/ui/components/coral/foundation/form/numberfield",
"label": "Results per page",
"name": "./resultsPerPage",
"min": 1,
"max": 50,
"value": 10
},
"noResultsMessage": {
"sling:resourceType": "granite/ui/components/coral/foundation/form/textfield",
"label": "No-results message",
"name": "./noResultsMessage"
},
"helpfulLinks": {
"sling:resourceType": "granite/ui/components/coral/foundation/form/multifield",
"label": "Helpful links",
"name": "./helpfulLinks",
"fields": {
"linkLabel": { "type": "textfield", "label": "Link label" },
"linkUrl": { "type": "textfield", "label": "URL" }
}
}
}
}
}
13. QA Acceptance Checklist
- Search input renders at 3.5rem height with magnifying glass icon and clear button.
- Placeholder text displays correctly and is customisable via dialog.
- Focus ring appears on input using
--caat-focustoken colour. - Clear button resets the input and is keyboard accessible.
- Suggestion dropdown appears on typing with correct hover/focus states.
- Arrow keys, Enter, and Escape work correctly with suggestions.
- Search results display title (linked), URL breadcrumb, excerpt, and category tag.
- Search term is highlighted with
<mark>in result excerpts. - Results count displays correctly (e.g. "12 results for 'pension benefits'").
- No-results state shows message, suggestions, and helpful links.
-
role="search"is present on the form element. - Screen readers announce result count via
aria-liveregion. - Analytics events (
search-submitted,search-result-click,search-no-results) fire correctly. - Cross-browser tested: Chrome, Firefox, Safari, Edge.
14. Definition of Done
| Area | Done means |
|---|---|
| Design | Figma component matches this contract. Input, suggestions, results, and no-results variants are documented. All interactive states (hover, focus, active) specified. |
| Development | AEM proxy component created. HTL template emits semantic HTML per Section 6. CSS uses design tokens exclusively. JS handles typeahead, keyboard nav, and clear. Unit and integration tests pass. |
| QA | All items in the QA Acceptance Checklist (Section 13) pass. Manual accessibility audit completed. Cross-browser tested (Chrome, Firefox, Safari, Edge). |
| Launch | Component deployed to AEM production. Search endpoint configured and returning results. Content authors trained on configuration options. Analytics dashboards confirmed receiving events. |