children | node | <Option /> and <OptionGroup /> elements. | |
className | string | Adds a className to the outermost element. | |
darkMode | boolean | Determines whether or not the component will appear in dark mode. | false |
size | 'xsmall' , 'small' , 'default' , 'large' | Sets the size of the component's elements. | 'default' |
id | string | id associated with the Select component. | |
name | string | The name that will be used when submitted as part of a form. | |
label | string | Text shown in bold above the input element. | |
aria-labelledby | string | Must be provided if and only if neither label nor aria-label is not provided. | |
aria-label | string | Must be provided if and only if neither label nor aria-labelledby is not provided. | |
description | React.ReactNode | Text that gives more detail about the requirements for the input. | |
placeholder | string | The placeholder text shown in the input element when an option is not selected. | 'Select' |
disabled | boolean | Disables the component from being edited. | false |
value | string | Sets the <Option /> that will appear selected and makes the component a controlled component. | '' |
defaultValue | string | Sets the <Option /> that will appear selected on page load when the component is uncontrolled. | '' |
onChange | function | A function that gets called when the selected value changes. Receives the value string as the first argument. | () => {} |
readOnly | boolean | Disables the console warning when the component is controlled and no onChange prop is provided. | false |
allowDeselect | boolean | Enables or disables the option for a user to select a null default value. | true |
usePortal | boolean | Determines if Select dropdown will be rendered inside a portal. | true |
portalContainer | HTMLElement | null | Sets the container used for the popover's portal. NOTE: If using a scrollContainer make sure that the portalContainer is contained within the scrollContainer . E.g, passing the same refrence to scrollContainer and portalContainer . | |
scrollContainer | HTMLElement | null | If the popover portal has a scrollable ancestor other than the window, this prop allows passing a reference to that lement to allow the portal to position properly. | |
portalClassName | string | Passes the given className to the popover's portal container if the default portal container is being used. | |
popoverZIndex | number | Sets the z-index CSS property for the popover. | |
state | 'none' , 'error' | Determines the state of the <select> | 'none' |
errorMessage | string | Text that shows when the state is set to error . | |
baseFontSize | '13' , '16' | Determines the base font size if sizeVariant is set to default | '13' |
dropdownWidthBasis | 'option' | 'trigger' | Determines the width of the dropdown. trigger will make the dropdown width the width of the menu trigger. option will make the dropdown width as wide as the widest option. | trigger |