Appearance
File Gallery
SCAFileGallery shows items as tiles with a large icon, a selection checkbox and a name. It does not own any data or drag-and-drop logic: the page passes the items, the extractors and the container's drop handlers (from useDropTarget, see Drag and drop list). Icon names are typed (IconName); see Icons. For a file, fileTypeIcon({ mimeType, extension, fileName }) returns its icon and colour.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
items | GalleryItem[] | — | Items to show; each has at least an id. Required. |
keyExtractor | (item) => string | — | Unique key of an item (also the drag id). Required. |
iconExtractor | (item) => { icon: IconName; color?: string } | — | Icon of an item, shown at 45 px, and its fixed colour (the color prop of SCASvgIcon). Required. |
nameExtractor | (item) => string | — | Name shown under the icon. Required. |
isFolder | (item) => boolean | — | Whether the item is a folder. Required. |
selectedItems | string[] | — | Keys of the selected items. Required. |
gridHandlers | ContainerHandlers & WholeElementContainerHandlers | — | Drag and drop listeners for the grid container. Required; pass no-op handlers to disable drag and drop. |
loading | boolean | false | Show the loading state. |
busy | boolean | false | Overlay while an operation runs. |
lineStyle | LineStyle | null | null | Position of the single drop-insertion line. |
lineClass | string | '' | CSS class of that line. |
insideTargetId | string | null | null | Key of the tile highlighted as an "inside" drop target. |
Emits
| Event | Payload | When |
|---|---|---|
item-click | GalleryItem | A tile is clicked. |
update:selected-items | string[] | A tile checkbox is toggled; the payload is the new selection. |
Exposed: galleryGridEl, the grid element. An empty list shows the "no items" state.