SearchResult
One search result: the title in bold, a line of the page under it, and the words that matched underlined with light.
import SearchResult from '@sypnia/ui/astro/SearchResult.astro'
Results, and while they load
query marks the words. SearchResultSkeleton on the right.
Code
---
import SearchResult from '@sypnia/ui/astro/SearchResult.astro';
import SearchResultSkeleton from '@sypnia/ui/astro/SearchResultSkeleton.astro';
---
<div class="sy-cols" style="--cols:2;max-width:44rem">
<div>
<SearchResult title="Import a CSV" href="#" text="Upload a file, map the columns, preview the rows." query="csv import" selected />
<SearchResult title="Export as CSV" href="#" text="Every table can be downloaded as CSV." query="csv import" />
</div>
<SearchResultSkeleton items={2} />
</div> When to use it
Use it when
- A search page rendered on the server, or results shown outside the dialog.
Do not use it when
- Inside Search: it draws its own results.
For everyone
- The match is marked with
<mark>, so it is not only a colour.