Select
Displays a list of options for the user to pick from—triggered by a button.
Installation
Or if you prefer using Shadcn primitives, use
Examples
Custom Options
API Reference
Select
A Select
is a generic component Select<T>
, where T
extends string
.
Prop | Type | Default | Description |
---|---|---|---|
options * | Record<T, string | Option> | - | The available options. |
value | T | - | The selected value. |
disabled | boolean | - | Whether the select is disabled. |
hideCheck | boolean | - | Whether the check ✔️ should be hidden. |
side | "top" | "right" | "bottom" | "left" | "bottom" | The preferred side of the anchor to render against when open. |
align | "start" | "center" | "end" | "end" | The preferred alignment against the anchor. |
onChange | (value: T) => void | - | Handler that is called when an option is selected. |
renderOption | React.FC<{ option?: Option | string }> | - | A custom renderer for SelectItem . |
type
Option
Prop | Type | Description |
---|---|---|
label * | string | The option name. |
description | string | The description of the option. |