# Select

Single-select dropdown with arrow-key navigation



<ComponentPreview base="opentui" name="select-demo" />

Installation [#installation]

<CodeTabs>
  <TabsList>
    <TabsTrigger value="cli">
      Command
    </TabsTrigger>

    <TabsTrigger value="manual">
      Manual
    </TabsTrigger>
  </TabsList>

  <TabsContent value="cli">
    ```bash
    npx shadcn@latest add @termcn/opentui-select
    ```
  </TabsContent>

  <TabsContent value="manual">
    <Steps>
      <Step>
        Copy and paste the following code into your project.
      </Step>

      <ComponentSource base="opentui" name="select" title="components/ui/select.tsx" />

      <Step>
        Update the import paths to match your project setup.
      </Step>
    </Steps>
  </TabsContent>
</CodeTabs>

Usage [#usage]

```tsx
import { Select } from "@/components/ui/select";
```

```tsx
<Select
  label="Choose a framework"
  options={[
    { value: "next", label: "Next.js" },
    { value: "remix", label: "Remix" },
    { value: "astro", label: "Astro" },
  ]}
  onChange={(value) => {}}
/>
```

API Reference [#api-reference]

Select [#select]

| Prop          | Type                 | Default    |
| ------------- | -------------------- | ---------- |
| `options`     | `SelectOption<T>[]`  | `required` |
| `value`       | `T`                  | -          |
| `onChange`    | `(value: T) => void` | -          |
| `onSubmit`    | `(value: T) => void` | -          |
| `label`       | `string`             | -          |
| `cursor`      | `string`             | `"›"`      |
| `cursorColor` | `string`             | -          |
