UNPKG

@ui5/webcomponents-react

Version:

React Wrapper for UI5 Web Components and additional components

52 lines (51 loc) 2.43 kB
'use client'; import { withWebComponent } from '@ui5/webcomponents-react-base'; /** * 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 touch devices - the user can navigate using the navigation arrows (always visible) or 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. * * ### Hidden Items * * Carousel items can be conditionally hidden by adding the `hidden` attribute to any child element. * Hidden items are automatically excluded from carousel navigation and will not be displayed or counted in pagination. * This allows for dynamic showing or hiding of carousel items without affecting the overall carousel behavior. * * ### 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! [Carousel UI5 Web Component Documentation](https://ui5.github.io/webcomponents/components/Carousel) | [Repository](https://github.com/UI5/webcomponents) */ const Carousel = withWebComponent('ui5-carousel', ['accessibleName', 'accessibleNameRef', 'arrowsPlacement', 'backgroundDesign', 'itemsPerPage', 'pageIndicatorBackgroundDesign', 'pageIndicatorBorderDesign', 'pageIndicatorType'], ['cyclic', 'hideNavigationArrows', 'hidePageIndicator'], [], ['navigate']); Carousel.displayName = 'Carousel'; export { Carousel };