Search page
@opeolluwa/ryder/pages/Search.vue renders grouped search results. The app keeps its queries and passes the rows in; the page only presents them.
vue
<script setup lang="ts">
import SearchPage from "@opeolluwa/ryder/pages/Search.vue"
import type { SearchSection } from "@opeolluwa/ryder/types"
const sections = computed<SearchSection[]>(() => /* filter your cached rows */ [])
</script>
<template>
<SearchPage :sections="sections" :loading="loading" @back="goBack" />
</template>Props: sections, loading, query (defaults to the route's ?q=), noQueryMessage, emptyIcon, emptyTitle, emptyDescription, emptyActionLabel.
Emits back — wire it to override the default back navigation.
Types
SearchResultItem— one row:title, optionalsubtitle/badge, and atoroute the row navigates to.SearchSection— a grouped block:key,title,count,items[], and an optionalviewAllTo.countis shown beside the heading and may differ fromitems.lengthwhen a section is capped for display.
Matching helpers
@opeolluwa/ryder/utils ships the search text helpers so every consumer matches and emphasises the same way:
normalize(text)— lower-cased, trimmed;null/undefinedcollapse to"".escapeHtml(text)— safe interpolation intov-html.truncate(text, max = 120)— clip with an ellipsis.highlight(text, query)— HTML with everyquerymatch wrapped in<mark>; escapes first so user text can never become markup.