# Shadcn Labeled

> Control with label

- Type: example, free and open source (MIT)
- Component: [Autocomplete](https://reui.io/components/autocomplete.md)
- Page: https://reui.io/components/autocomplete/c-autocomplete-4
- 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-4")`
- Registry item: https://reui.io/r/styles/base-nova/c-autocomplete-4.json
- Uses: Autocomplete, Label

## Best for

A shadcn Label stacked above the input and tied to it by a shared id, with auto highlight on

## When not to use

- A labelled field that also validates and shows an error message on submit: use [Form Integration](https://reui.io/components/autocomplete/c-autocomplete-12.md) (`get_example("c-autocomplete-12")`)

## Install

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

## 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.
