Select

Select component documentation.

Usage

import {
  Select,
  SelectTrigger,
  SelectContent,
  SelectItem,
} from "@aqqo/aqqo-ui";
<Select>
  <SelectTrigger>
    <SelectValue placeholder="Select an option" />
  </SelectTrigger>
  <SelectContent>
    <SelectItem value="1">Option 1</SelectItem>
    <SelectItem value="2">Option 2</SelectItem>
    <SelectItem value="3">Option 3</SelectItem>
  </SelectContent>
</Select>

Examples

With label

<div className="grid w-full max-w-sm items-center gap-2">
  <Label htmlFor="test" id="name">
    Select option
  </Label>
  <Select>
    <SelectTrigger id="test" aria-labelledby={id}>
      <SelectValue placeholder="Select an option" />
    </SelectTrigger>
    <SelectContent>
      <SelectItem value="1">Option 1</SelectItem>
      <SelectItem value="2">Option 2</SelectItem>
      <SelectItem value="3">Option 3</SelectItem>
    </SelectContent>
  </Select>
</div>

Disabled

Props

Select Component Props
PropTypeValuesDescription
defaultValuestring-The initial selected value of the select component
disabledbooleantrue | false (default)Determines if the select is disabled
classNamestring-Additional CSS classes for custom styling
positionstringitem-aligned | popper (default)Positioning strategy for the select dropdown
...propsany-Additional HTML attributes for the select component
Select Subcomponents
ComponentPropTypeValuesDescription
Select.Triggerdisabledbooleantrue | false (default)Determines if the trigger is disabled
Select.Contentpositionstringpopper (default) | item-alignedPositioning strategy for the content
Select.Itemdisabledbooleantrue | false (default)Determines if the item is disabled
Select.Itemvaluestring-Value of the select item
Select.Labelasstring-Specifies the element type for the label
Select.Separator---Used to separate items within the select component
Select.ScrollUpButton---Button to scroll up in the list
Select.ScrollDownButton---Button to scroll down in the list

On this page

  1. Usage
  2. Examples
  3. With label
  4. Disabled
  5. Props
Scroll to top