# Shadcn Search Results

> With search results

- Type: example, free and open source (MIT)
- Component: [Autocomplete](https://reui.io/components/autocomplete.md)
- Page: https://reui.io/components/autocomplete/c-autocomplete-9
- Docs (Base UI): https://reui.io/docs/components/base/autocomplete.md
- Docs (Radix UI): https://reui.io/docs/components/radix/autocomplete.md
- MCP: `get_example("c-autocomplete-9")`
- Registry item: https://reui.io/r/styles/base-nova/c-autocomplete-9.json
- Uses: Autocomplete, Avatar

## Best for

A debounced lookup of 25 developers with a spinner, error text and result count in a status line

## Agent notes

- Replace `searchDevelopers` with your request; it waits 200 to 1000ms at random and throws on 2% of calls or when the query is "error"
- Keep the `ignore` flag when you swap in a real fetch, since it discards a response that lands after the query changed
- `shouldRenderPopup` keeps the popup unmounted while `searchValue` is empty, so the chevron opens nothing before typing

## When not to use

- Options known up front in the page, with no request, loading or error states: use [Clear & Trigger](https://reui.io/components/autocomplete/c-autocomplete-7.md) (`get_example("c-autocomplete-7")`)

## Third-party libraries

- Base UI v1: [API reference](https://base-ui.com/react/components), [docs](https://base-ui.com/react/overview/quick-start), [llms.txt](https://base-ui.com/llms.txt)

## Install

```bash
npx shadcn@latest add @reui/c-autocomplete-9
```

## About Shadcn Autocomplete

### When to use

- Search and filter fields that suggest matching options while the user types
- People and record lookups, grouped by team or fetched from a server as the query changes
- Form fields whose typed or picked text is validated with the rest of the form on submit

### When not to use

- A selection that stores the chosen option rather than typed text, or several as chips: use [Combobox](https://reui.io/components/combobox.md) (`get_component("combobox")`)
- Options nested in levels that the user drills into one level at a time: use [Cascader](https://reui.io/components/cascader.md) (`get_component("cascader")`)
- A palette of app actions and keyboard shortcuts, often opened in a dialog: use [Command](https://reui.io/components/command.md) (`get_component("command")`)

### Agent notes

- `value` and `onValueChange` carry the input text as a string; picking an item only fills that text and stores no item object
- Both twins are built on `@base-ui/react`, so installing it in a radix project adds Base UI as a dependency
- A Server Component cannot create the function child of `AutocompleteList`, so the file that renders it needs a use client directive

Every ReUI item has a twin like this one; the index is https://reui.io/llms.txt. Agents with the ReUI MCP (https://reui.io/docs/mcp) get the same guidance from the getters named above.
