# MentionPicker

Type @ to add files, symbols, people or sources.

- **Use it for**: Adding files, symbols, people or sources with "@".
- **Not for**: Commands. Try [SlashCommandMenu](https://unseenui.com/components/slash-command-menu/).

## Installation

```bash
npm install @stackunseen/ui
```

## Usage

```tsx
import { MentionPicker } from '@stackunseen/ui';
import '@stackunseen/ui/styles.css';

<MentionPicker variant="list" items={references} query={query} onQueryChange={setQuery} onSelect={addReference} />
```

## All props

| Prop | Type | Description |
| --- | --- | --- |
| `className` | `string` | Added to the root element, after the component's own classes. |
| `disabled` | `boolean` |  |
| `error` | `string` |  |
| `items` (required) | `readonly ReferenceOption[]` |  |
| `onQueryChange` (required) | `(query: string) => void` |  |
| `onSelect` (required) | `(item: ReferenceOption) => void` |  |
| `query` (required) | `string` |  |
| `status` | `"unknown" \| "ready" \| "loading" \| "denied" \| "error" \| "stale"` |  |
| `variant` | `"list" \| "cards" \| "compact"` |  |

## Keyboard

Tab reaches controls; Enter or Space activates buttons. Accordions use arrow keys, Home and End. Select menus support arrows and typeahead; Escape closes menus and dialogs and restores focus.

## Works with

[MemoryControls](https://unseenui.com/components/memory-controls/), [ContextInspector](https://unseenui.com/components/context-inspector/), [ContextBar](https://unseenui.com/components/context-bar/), [MemoryPanel](https://unseenui.com/components/memory-panel/)

Page: https://unseenui.com/components/mention-picker/
