Reactolith UI Getting Started Introduction Installation Usage Layout Aspect Ratio Card Resizable Scroll Area Separator Direction Provider Forms Button Button Group Calendar Checkbox Combobox Field Input Input Group Input OTP Label Native Select Radio Group Select Slider Switch Textarea Toggle Toggle Group Data Display Accordion Avatar Badge Carousel Chart Collapsible Item Kbd Table Feedback Alert Empty Progress Skeleton Sonner Spinner Overlay Alert Dialog Context Menu Dialog Dropdown Menu Hover Card Popover Sheet Tooltip Navigation Breadcrumb Command Menubar Navigation Menu Pagination Sidebar Tabs

Select

Displays a list of options for the user to pick from, triggered by a button.

Preview

Fruits Apple Banana Orange Grape

Usage

<ui-select>
  <ui-select-trigger class="max-w-[180px] w-full">
    <ui-select-value placeholder="Select a fruit"></ui-select-value>
  </ui-select-trigger>
  <ui-select-content>
    <ui-select-group>
      <ui-select-label>Fruits</ui-select-label>
      <ui-select-item value="apple">Apple</ui-select-item>
      <ui-select-item value="banana">Banana</ui-select-item>
      <ui-select-item value="orange">Orange</ui-select-item>
      <ui-select-item value="grape">Grape</ui-select-item>
    </ui-select-group>
  </ui-select-content>
</ui-select>

Sub-components

<ui-select> <ui-select-trigger> <ui-select-value> <ui-select-content> <ui-select-group> <ui-select-label> <ui-select-item> <ui-select-separator> <ui-select-scroll-up-button> <ui-select-scroll-down-button>

Props

<ui-select>

PropTypeDefaultDescription
valuestringControlled selected value.
default-valuestringDefault selected value.

<ui-select-value>

PropTypeDefaultDescription
placeholderstringPlaceholder text.

<ui-select-item>

PropTypeDefaultDescription
valuestringThe item value.

All components also accept standard HTML attributes (class, id, style, data-*, aria-*, etc.) which are passed through to the underlying element.