# Dropdown (https://www.librechat.ai/docs/development/components/dropdown)

`Dropdown` is LibreChat's single-value select. In a form, use the `field` variant, which matches `Input`. For a menu of actions instead of values, use `DropdownPopup`.

<ComponentPreview example="dropdown/field" title="Dropdown in a form" minHeight={280} />

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | `string` | | The selected option's value. |
| `onChange` | `(value: string) => void` | | Called with the picked option's value. |
| `options` | `Array<string \| { value, label, icon?, disabled? } \| { divider: true }>` | | The choices, in order. |
| `variant` | `'default' \| 'field' \| 'compact'` | `'default'` | `field` matches `Input` in forms; `compact` fits toolbars. |
| `placeholder` | `string` | | Shown in the secondary tone while nothing is chosen. |
| `searchable` | `boolean` | `false` | Adds a search field at the top of the list. |
| `aria-labelledby` | `string` | | Points at the field's visible label. The selected value is announced with it. |
| `aria-invalid` | `boolean` | | Marks a `field` dropdown invalid. |
| `disabled` | `boolean` | `false` | Blocks opening the list. |
| `portal` | `boolean` | `true`, or `false` inside a dialog | Renders the list in a portal. Inside a dialog the list stays in the dialog so focus and screen readers can reach it. |

## Accessibility

The trigger is a `combobox` that opens a `listbox`. Name it with `aria-labelledby` pointing at a visible label, or `aria-label` when there is none.

| Key | Action |
| --- | --- |
| <kbd>Enter</kbd>, <kbd>Space</kbd> or <kbd>↓</kbd> | Opens the list |
| <kbd>↑</kbd> and <kbd>↓</kbd> | Move through the options |
| <kbd>Enter</kbd> | Picks the active option and closes the list |
| <kbd>Escape</kbd> | Closes the list without changing the value |
