# App, search results

- **[Sections](/blocks/)**
- **[Application](/blocks/app/)**
- **App, search results**

A results page: a search box, checkbox facets whose counts follow the other filters, active filters as removable chips, a result count that is announced when it…

## Import

- **CLI**

  ```
  npx shadcn add @klarhimmel/app-search-results
  ```
- **Import**

  ```
  import Block from '@/components/klarhimmel/blocks/app-search-results';
  ```

Also called

- app/search-results

- **About**: A results page: a search box, checkbox facets whose counts follow the other filters, active filters as removable chips, a result count that is announced when it changes, and a no-results state with suggestions.
- **Category**: Interface sections for signed-in products. New project? Set it up once: /get-started/installation.

## Notes

- **When to use it**: A results page with a search box, checkbox filters and a count. For a plain sortable list of records, `app-data-table` and `app-data-filters` are the better pair; this block is for content that people search by words.
- **Writing for it**: - Each result has a title (80), a summary (160) and a matches list of up to 3 words. The matches must be written exactly like the facet option labels, because that is how filtering and the counts work.
- Within one facet the options add up, and across facets they narrow. Make that obvious in the facet names (30), for example Type and Price, not two facets that overlap.
- Give suggestions (up to 4, 40 characters each) as real searches that return something, since they only appear on the no-results state.
- **Watch out for**: The text search runs on the results you supply, so 12 results is the ceiling and anything beyond that must be paged by your own app. The count in each option updates with the other filters and shows blank outside the filled state.

## Pairs well with

- **[App, filter bar](/blocks/app/data-filters)**
- **[App, pagination](/blocks/app/data-pagination)**
- **[App, top bar](/blocks/app/shell-topbar)**

## Usage

The block in a page, with its default content (long lists shortened). Every prop is in the table below.

section.tsx

```
import { Theme } from '@/components/klarhimmel/theme/style';
import { BlockSurface } from '@/components/klarhimmel/blocks/surface';
import AppSearchResults, { spec } from '@/components/klarhimmel/blocks/app-search-results';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <AppSearchResults props={spec.defaults} />
      </BlockSurface>
    </Theme>
  );
}
```

## Props

The type, default and text limit of every prop. On a real page, over-limit text is kept and checkSections flags it (Installation, Check a page before you ship); this live preview shows the default until it fits. The panel above edits all props.

- **eyebrow**: Text, up to 60 characters. Optional; empty is not rendered.
- **title**: Text, up to 120 characters.
- **description**: Text, up to 300 characters. Optional; empty is not rendered.
- **searchLabel**: Text, up to 40 characters.
- **searchButton**: Text, up to 30 characters.
- **query**: Text, up to 80 characters.
- **facets**: List of 1 to 3. Each item: name, options.
- **results**: List of up to 12. Each item: title, summary, href, meta (optional), matches.
- **resultsLabel**: Text, up to 20 characters.
- **singular**: Text, up to 20 characters.
- **forLabel**: Text, up to 10 characters.
- **removeLabel**: Text, up to 30 characters.
- **clearAll**: Text, up to 30 characters.
- **filtersLabel**: Text, up to 30 characters.
- **noResults**: Fields: title, hint, suggestionsLabel.
- **suggestions**: List of up to 4.
- **state**: One of 'filled', 'empty', 'loading', 'error'.
- **messages**: Fields: loading, error, retry.
- **headingLevel**: One of '1', '2'. Optional; empty is not rendered.

[Previous](/blocks/app/scheduling-slots)

[Next](/blocks/app/settings-danger)
