Overview

The select component is a component that allows users to pick a value from predefined options.

Properties

PropertiesDescription
defaultValueThe value of the select when initially rendered. Use when you do not need to control the state of the select.
valueThe controlled value of the select. Should be used in conjunction with onValueChange.
defaultOpenThe open state of the select when it is initially rendered. Use when you do not need to control its open state.
openThe controlled open state of the select. Must be used in conjunction with onOpenChange.
onOpenChangeEvent handler called when the open state of the select changes.
dirThe reading direction of the select when applicable. If omitted, inherits globally from DirectionProvider or assumes LTR (left-to-right) reading mode.
nameThe name of the select. Submitted with its owning form as part of a name/value pair.
onChange
iconA small icon often displayed next to the value as a visual affordance for the fact it can be open. By default renders ▼ but you can use your own icon via asChild or use children.
placeholder
refThe ref property allows users to attach React refs to the component. Learn more about refs in React here
children