("apple");
return (
Selected value: {fruit ?? "null"}
setFruit(null)}>
Reset
);
}
```
### Different sizes
The `Select` component can be rendered at `sm`, `md`, or `lg` size, defaulting to `md`. Size affects the height, padding, and text styles of the trigger, as well as the size of its icons.
```tsx demo
import { Select } from "@tenstorrent/vesper/select";
const COUNTRIES = [
{ label: "Canada", value: "ca" },
{ label: "Japan", value: "jp" },
{ label: "Norway", value: "no" },
];
export default function SelectSizes() {
return (
);
}
```
### Rendering an icon
You can render an icon at the leading edge of the trigger via the `icon` prop. The icon is decorative, and stays in place as the selection changes:
```tsx demo
import { Globe } from "@tenstorrent/vesper/icons";
import { Select } from "@tenstorrent/vesper/select";
export default function SelectWithIcon() {
return (
}
placeholder="Select a region"
options={[
{ label: "United States", value: "us" },
{ label: "Europe", value: "eu" },
{ label: "Asia Pacific", value: "ap" },
]}
/>
);
}
```
> [!NOTE]
>
> The trailing caret is rendered by the component itself, and flips between its open and closed states as the dropdown is toggled. Only the leading icon is configurable.
### Disabling the select
Pass `disabled` to prevent all interaction with the trigger and its dropdown. A disabled `Select` still displays its current selection, but is skipped in the tab order and excluded from form data:
```tsx
import { Select } from "@tenstorrent/vesper/select";
export default function DisabledSelect() {
return (
);
}
```
### Usage in forms
`Select` renders a hidden form control alongside its trigger, so passing a `name` includes the selected value in form submissions, and `required` participates in native form validation. Use the `form` prop to associate the field with a `