R

Select

20 parts

Anatomy

Import the parts and compose them. Each part forwards attributes to its underlying element.

vue
import {
  SelectRoot,
  SelectTrigger,
  SelectValue,
  SelectIcon,
  SelectPortal,
  SelectContent,
  SelectContentImpl,
  SelectItemAlignedPosition,
  SelectPopperPosition,
  SelectViewport,
  SelectScrollUpButton,
  SelectScrollDownButton,
  SelectGroup,
  SelectLabel,
  SelectItem,
  SelectItemText,
  SelectItemIndicator,
  SelectSeparator,
  SelectArrow,
  SelectScrollButtonImpl,
} from '@robonen/primitives/select';

<SelectRoot>
  <SelectTrigger />
  <SelectValue />
  <SelectIcon />
  <SelectPortal />
  <SelectContent />
  <SelectContentImpl />
  <SelectItemAlignedPosition />
  <SelectPopperPosition />
  <SelectViewport />
  <SelectScrollUpButton />
  <SelectScrollDownButton />
  <SelectGroup />
  <SelectLabel />
  <SelectItem />
  <SelectItemText />
  <SelectItemIndicator />
  <SelectSeparator />
  <SelectArrow />
  <SelectScrollButtonImpl />
</SelectRoot>

API Reference

SelectRoot

Root
PropTypeDescription
dir?DirectionReading direction. Falls back to ConfigProvider.
disabled?booleanDisable the whole select.
required?booleanMark field as required for native form validation.
name?stringNative input name for form submission.
defaultValue?stringUncontrolled default value.
defaultOpen?booleanUncontrolled default open state.
autocomplete?stringNative autocomplete attribute forwarded to the hidden input.

SelectTrigger

Trigger
PropTypeDescription
disabled?booleanDisable this trigger independently from the root.

SelectValue

Value
PropTypeDescription
placeholder?stringText shown when no option is selected.

SelectIcon

Icon

No props or events — renders its element and forwards attributes.

SelectPortal

Portal

No props or events — renders its element and forwards attributes.

SelectContent

Content

No props or events — renders its element and forwards attributes.

SelectContentImpl

ContentImpl
PropTypeDescription
position?'item-aligned' | 'popper'Position mode.
disableOutsidePointerEvents?booleanBlock outside pointer events.

SelectItemAlignedPosition

ItemAlignedPosition
PropTypeDescription
dir?string

SelectPopperPosition

PopperPosition

No props or events — renders its element and forwards attributes.

SelectViewport

Viewport

No props or events — renders its element and forwards attributes.

SelectScrollUpButton

ScrollUpButton

No props or events — renders its element and forwards attributes.

SelectScrollDownButton

ScrollDownButton

No props or events — renders its element and forwards attributes.

SelectGroup

Group

No props or events — renders its element and forwards attributes.

SelectLabel

Label

No props or events — renders its element and forwards attributes.

SelectItem

Item
PropTypeDescription
valuestringThe option value.
disabled?booleanDisable this item.

SelectItemText

ItemText

No props or events — renders its element and forwards attributes.

SelectItemIndicator

ItemIndicator

No props or events — renders its element and forwards attributes.

SelectSeparator

Separator

No props or events — renders its element and forwards attributes.

SelectArrow

Arrow

No props or events — renders its element and forwards attributes.

SelectScrollButtonImpl

ScrollButtonImpl
PropTypeDescription
direction1 | -1