Class: MediaGridComponent

MediaGridComponent(dataObject, optionsopt)

MediaGridComponent creates a CSS grid of CardComponents like ImageCardComponent or custom components that you make for other media like videos, audio tracks, etc. It uses a CollectionComponent with the `itemComponent` option set to a CardComponent like ImageCardComponent.

Constructor

new MediaGridComponent(dataObject, optionsopt)

Parameters:
Name Type Attributes Default Description
dataObject DataCollection null
options Object <optional>
{}
Properties
Name Type Attributes Default Description
itemComponent Component <optional>
CardComponent the options object to pass to the item class constructor
itemOptions Object <optional>
{} the Component **class** used for each item in the DataCollection
Source:
To Do:
  • Support pagination once 'CollectionComponent' supports it
Example
const dataCollection = new DataCollection(...snip...)
const mediaGridComponent = new MediaGridComponent(dataCollection, {
	itemComponent: ImageCardComponent,
	itemOptions: { someKey: 'someValue' }
})