@ui5/webcomponents-react
Version:
React Wrapper for UI5 Web Components and additional components
55 lines (54 loc) • 2.67 kB
JavaScript
'use client';
import '@ui5/webcomponents/dist/List.js';
import { withWebComponent } from '@ui5/webcomponents-react-base';
/**
* The `List` component allows displaying a list of items, advanced keyboard
* handling support for navigating between items, and predefined modes to improve the development efficiency.
*
* The `List` is a container for the available list items:
*
* - `ListItemStandard`
* - `ListItemCustom`
* - `ListItemGroup`
*
* To benefit from the built-in selection mechanism, you can use the available
* selection modes, such as
* `Single`, `Multiple` and `Delete`.
*
* Additionally, the `List` provides header, footer, and customization for the list item separators.
*
* ### Keyboard Handling
*
* #### Basic Navigation
* The `List` provides advanced keyboard handling.
* When a list is focused the user can use the following keyboard
* shortcuts in order to perform a navigation:
*
* - [Up] or [Down] - Navigates up and down the items
* - [Home] - Navigates to first item
* - [End] - Navigates to the last item
*
* The user can use the following keyboard shortcuts to perform actions (such as select, delete),
* when the `selectionMode` property is in use:
*
* - [Space] - Select an item (if `type` is 'Active') when `selectionMode` is selection
* - [Delete] - Delete an item if `selectionMode` property is `Delete`
*
* #### Fast Navigation
* This component provides a build in fast navigation group which can be used via [F6] / [Shift] + [F6] / [Ctrl] + [Alt/Option] / [Down] or [Ctrl] + [Alt/Option] + [Up].
* In order to use this functionality, you need to import the following module:
* `import "@ui5/webcomponents-base/dist/features/F6Navigation.js"`
*
*
*
* `import "@ui5/webcomponents/dist/ListItemStandard.js";` (for `ListItemStandard`)
*
* `import "@ui5/webcomponents/dist/ListItemCustom.js";` (for `ListItemCustom`)
*
* `import "@ui5/webcomponents/dist/ListItemGroup.js";` (for `ListItemGroup`)
*
* __Note:__ This is a UI5 Web Component! [List UI5 Web Component Documentation](https://ui5.github.io/webcomponents/components/List) | [Repository](https://github.com/UI5/webcomponents)
*/
const List = withWebComponent('ui5-list', ['accessibilityAttributes', 'accessibleDescription', 'accessibleDescriptionRef', 'accessibleName', 'accessibleNameRef', 'accessibleRole', 'footerText', 'growing', 'growingButtonText', 'headerText', 'loadingDelay', 'noDataText', 'selectionMode', 'separators'], ['indent', 'loading', 'stickyHeader'], ['header'], ['item-click', 'item-close', 'item-delete', 'item-toggle', 'load-more', 'move-over', 'move', 'selection-change']);
List.displayName = 'List';
export { List };