Learn about the Select component for use in UI extensions.
Select
component renders a dropdown menu select field where a user can select a single value. A search bar will be automatically included when there are more than seven options.
Prop | Type | Description |
---|---|---|
name | String | The input’s unique identifier. |
label | String | The text that displays above the input. |
options | Array | The options to display in the dropdown menu. label will be used as the display text, and value should be the option’s unique identifier, which is submitted with the form. |
value | String | number | boolean | The value of the input. |
variant | input (default) | transparent | The visual style of the button |
required | Boolean | When set to true , displays a required field indicator. Default is false . |
readOnly | Boolean | When set to true , users will not be able to fill the input field. Default is false . |
tooltip | String | The text that displays in a tooltip next to the label. |
description | String | Text that describes the field’s purpose. |
error | Boolean | When set to true , validationMessage is displayed as an error message if provided. The input will also render its error state to let the user know there’s an error. If left false (default), validationMessage is displayed as a success message. |
validationMessage | String | The text to display if the input has an error. |
onChange | (value: string) => void | A callback function that is invoked when the value is committed. |
onInput | (value: string) => void | A callback function that is called and passed the value every time the search field is edited by the user. Prefer updating state in onChange as it fires less frequently, and if you need to update state here, consider debouncing your function. |
input
(default): a standard dropdown menu.transparent
: a hyperlink dropdown menu.