UseSelectParameters

Properties

Link copied to clipboard
abstract var areOptionsEqual: (a: OptionValue, b: OptionValue) -> Boolean?

A function used to determine if two options' values are equal. By default, reference equality is used.

Link copied to clipboard
abstract var buttonRef: Ref<Element>?

The ref of the trigger button element.

Link copied to clipboard
abstract var componentName: String?

The name of the component using useSelect. For debugging purposes.

Link copied to clipboard
abstract var defaultOpen: Boolean?

If true, the select will be open by default.

Link copied to clipboard
abstract var defaultValue: Any?

The default selected value. Use when the component is not controlled.

Link copied to clipboard
abstract var disabled: Boolean?

If true, the select is disabled.

Link copied to clipboard
abstract var getOptionAsString: (option: SelectOption<OptionValue>) -> String?

A function used to convert the option label to a string. This is useful when labels are elements and need to be converted to plain text to enable keyboard navigation with character keys.

Link copied to clipboard
abstract var getSerializedValue: Any?

A function to convert the currently selected value to a string. Used to set a value of a hidden input associated with the select, so that the selected value can be posted with a form.

Link copied to clipboard
abstract var listboxId: String?

The id attribute of the listbox element.

Link copied to clipboard
abstract var listboxRef: Ref<Element>?

The ref of the listbox element.

Link copied to clipboard
abstract var multiple: Any?

If true, the end user can select multiple values. This affects the type of the value, defaultValue, and onChange props.

Link copied to clipboard
abstract var name: String?

The name attribute of the hidden input element. This is useful when the select is embedded in a form and you want to access the selected value in the form data.

Link copied to clipboard
abstract var onChange: Any?

Callback fired when an option is selected.

Link copied to clipboard
abstract var onHighlightChange: Any?

Callback fired when an option is highlighted.

Link copied to clipboard
abstract var onOpenChange: (open: Boolean) -> Unit?

Callback fired when the listbox is opened or closed.

Link copied to clipboard
abstract var open: Boolean?

Controls the open state of the select's listbox. This is the controlled equivalent of the defaultOpen prop.

Link copied to clipboard
abstract var options: dynamic

An alternative way to specify the options. If this parameter is set, options defined as JSX children are ignored.

Link copied to clipboard
abstract var required: Boolean?

If true, the select embedded in a form must have a selected value. Otherwise, the form submission will fail.

Link copied to clipboard
abstract var value: Any?

The selected value. Set to null to deselect all options.