AssetGallery
A component for displaying a gallery of assets.
Example
Parameters
props
AssetGalleryPropsProps for the AssetGallery component.
onSelect
(assets: Asset[]) => voidselectable
booleanmultiSelect
'auto' | 'manual'Defines whether multiple assets can be selected.
If set to 'auto', the asset selection will be toggled when the user clicks on an asset. If set to 'manual', multiple selection will occur only if the user holds down the control/cmd key.
initialSelectedAssets
Asset[]The initial assets that should be selected.
pageSize
numberThe number of assets to display per page.
fixedHeight
booleanWhether the gallery should have a fixed height.
showHeader
booleanWhether the gallery should show a header.
className
stringThe class name to apply to the gallery.
onFilesDropped
(files: File[]) => voidThe function to call when files are dropped.
bulkActions
AssetBulkAction[]The bulk actions to display in the gallery.
displayBulkActions
booleanWhether the gallery should display bulk actions.
onPageSizeChange
(pageSize: number) => voidThe function to call when the page size changes.
viewMode
AssetViewModeThe current view mode for the gallery. Defaults to 'grid'.
onViewModeChange
(mode: AssetViewMode) => voidThe function to call when the view mode changes. When provided, a toggle will be rendered in the header bar.