@ui5/webcomponents-react
Version:
React Wrapper for UI5 Web Components and additional components
37 lines (36 loc) • 2.1 kB
JavaScript
'use client';
import '@ui5/webcomponents/dist/ComboBox.js';
import { withWebComponent } from '../../internal/withWebComponent.js';
/**
* The `ComboBox` component represents a drop-down menu with a list of the available options and a text input field to narrow down the options.
*
* It is commonly used to enable users to select an option from a predefined list.
*
* ### Structure
* The `ComboBox` consists of the following elements:
*
* - Input field - displays the selected option or a custom user entry. Users can type to narrow down the list or enter their own value.
* - Drop-down arrow - expands\collapses the option list.
* - Option list - the list of available options.
*
* ### Keyboard Handling
*
* The `ComboBox` provides advanced keyboard handling.
*
* - [F4], [Alt]+[Up], or [Alt]+[Down] - Toggles the picker.
* - [Escape] - Closes the picker, if open. If closed, cancels changes and reverts the typed in value.
* - [Enter] or [Return] - If picker is open, takes over the currently selected item and closes it.
* - [Down] - Selects the next matching item in the picker.
* - [Up] - Selects the previous matching item in the picker.
* - [Page Down] - Moves selection down by page size (10 items by default).
* - [Page Up] - Moves selection up by page size (10 items by default).
* - [Home] - If focus is in the ComboBox, moves cursor at the beginning of text. If focus is in the picker, selects the first item.
* - [End] - If focus is in the ComboBox, moves cursor at the end of text. If focus is in the picker, selects the last item.
*
*
*
* __Note__: This is a UI5 Web Component! [Repository](https://github.com/SAP/ui5-webcomponents) | [Documentation](https://sap.github.io/ui5-webcomponents/)
*/
const ComboBox = withWebComponent('ui5-combobox', ['accessibleName', 'accessibleNameRef', 'filter', 'name', 'placeholder', 'value', 'valueState'], ['disabled', 'loading', 'noTypeahead', 'readonly', 'required', 'showClearIcon'], ['icon', 'valueStateMessage'], ['change', 'input', 'selection-change']);
ComboBox.displayName = 'ComboBox';
export { ComboBox };