---
title: Select
description: A dropdown for picking one value from a short list.
---

<Component path="select/sizes" />

## Sizes

- `md` is the default. Use it in forms.
- `sm` fits dense rows, toolbars and slide panels. It is 32px tall with a smaller chevron.

Set the size on `SelectTrigger`. `SelectContent` already sits above slide panels and dialogs, so do not add a `z-*` class to it.

## Long lists

Pass `maxRows` to `SelectContent` when the list is long or sits above other fields. The list stops at that many rows and scrolls. Use 5 in forms and slide panels.

## FormSelect

`FormSelect` wraps the four Select parts with a label, a description and an error. Use it before you build a Select by hand.

<Component path="select/form-select-inline" />

- Without `label`, give it an `aria-label`. It then fits inline in a row.
- `size="sm"` uses the small trigger.
- `multiple` takes and returns an array of values.
- Pass `value={null}` with a `placeholder` when the user must make a choice. The placeholder shows in placeholder gray.
- The value type follows the options, so `onValueChange` needs no narrowing.
- Set `disabled` on an option to show it but block its selection.

### Warning

Set `variant="warning"` when the value is allowed but risky. The trigger border and the description turn amber, and the description gets a warning icon. An `error` still wins over the warning.

<Component path="select/form-select-warning" />

### Label action

Pass `labelAction` to put a small control, such as a ghost `Remove` button, at the right of the label row. The row keeps its height. `labelAction` needs a `label`.

<Component path="select/form-select-label-action" />
