Select
Overview
The select component is a component that allows users to pick a value from predefined options.
Properties
Properties | Description |
---|---|
defaultValue | The value of the select when initially rendered. Use when you do not need to control the state of the select. |
value | The controlled value of the select. Should be used in conjunction with onValueChange. |
defaultOpen | The open state of the select when it is initially rendered. Use when you do not need to control its open state. |
open | The controlled open state of the select. Must be used in conjunction with onOpenChange. |
onOpenChange | Event handler called when the open state of the select changes. |
dir | The reading direction of the select when applicable. If omitted, inherits globally from DirectionProvider or assumes LTR (left-to-right) reading mode. |
name | The name of the select. Submitted with its owning form as part of a name/value pair. |
onChange | |
icon | A 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 | |
ref | The ref property allows users to attach React refs to the component. Learn more about refs in React here |
children |
Updated 6 months ago