MediaGallery
<ui5-media-gallery> | Since 1.1.0The ui5-media-gallery component allows the user to browse through multimedia items. Currently,
the supported items are images and videos. The items should be defined using the ui5-media-gallery-item
component.
The items are initially displayed as thumbnails. When the user selects a thumbnail, the corresponding item is displayed in larger size.
The component is responsive by default and adjusts the position of the menu with respect to viewport size, but the application is able to further customize the layout via the provided API.
Keyboard Handling
The ui5-media-gallery provides advanced keyboard handling.
When the thumbnails menu is focused the following keyboard shortcuts allow the user to navigate through the thumbnail items:
- [Up] or [Down] - Navigates up and down the items
- [Home] - Navigates to first item
- [End] - Navigates to the last item
- [Space], [Enter] - Selects an item
ES6 Module Import
import "@ui5/webcomponents-fiori/dist/MediaGallery.js";
import "@ui5/webcomponents-fiori/dist/MediaGalleryItem.js";
Basic Sample
Properties
interactiveDisplayArea
layout
menuHorizontalAlign
menuVerticalAlign
showAllThumbnails
Slots
default
Events
display-area-click
overflow-click
selection-change
Methods
No methods available for this component.
CSS Parts
No CSS parts available for this component.
CSS Custom States
No CSS custom states available for this component.
More Samples
Vertical Layout
The thumbnails and selected item are vertically placed. To enable this layout - set layout="Vertical".
Horizontal Layout
The thumbnails and selected item are horizontally placed. To enable this layout - set layout="Horizontal". You can also define on which side of the selected item to place the thumbnails.
Custom Thumbnail
By default the image passed to the MediaGalleryItem is reused as a thumbnail. You can display another image as thumbnail via the thumbnail slot of the MediaGalleryItem.
Selected Item
You can predefine the selected item.
Disabled Item
The MediaGallery can show disabled items as well.
Interactive Display Area
Setting interactiveDisplayArea property makes the display area interactive, e.g. clickable.