UNPKG

@ui5/webcomponents-react

Version:

React Wrapper for UI5 Web Components and additional components

46 lines (45 loc) 1.97 kB
'use client'; import { withWebComponent } from '../../internal/withWebComponent.js'; /** * The Carousel allows the user to browse through a set of items. * The component is mostly used for showing a gallery of images, but can hold any other HTML element. * * There are several ways to perform navigation: * * - on desktop - the user can navigate using the navigation arrows or with keyboard shortcuts. * - on mobile - the user can use swipe gestures. * * ### Usage * * #### When to use: * * - The items you want to display are very different from each other. * - You want to display the items one after the other. * * #### When not to use: * * - The items you want to display need to be visible at the same time. * - The items you want to display are uniform and very similar. * * ### Keyboard Handling * * #### Basic Navigation * When the `Carousel` is focused the user can navigate between the items * with the following keyboard shortcuts: * * - [Up] or [Down] - Navigates to previous and next item * - [Left] or [Right] - Navigates to previous and next item * * ### 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"` * * * * __Note__: This is a UI5 Web Component! [Repository](https://github.com/SAP/ui5-webcomponents) | [Documentation](https://sap.github.io/ui5-webcomponents/) */ const Carousel = withWebComponent('ui5-carousel', ['accessibleName', 'accessibleNameRef', 'arrowsPlacement', 'backgroundDesign', 'itemsPerPage', 'pageIndicatorBackgroundDesign', 'pageIndicatorBorderDesign', 'pageIndicatorType'], ['cyclic', 'hideNavigationArrows', 'hidePageIndicator'], [], ['navigate']); Carousel.displayName = 'Carousel'; export { Carousel };