Grid List

You can add the component on any page in the template. You need to follow the steps given below: ‌

Step 1: You need to create an array that contains the data for the grid list. Also you need to add the code of grid list in the page where you want to add the component. Please check the code snippet given below, we have added the grid list in the Ecommerce Dashboard:

/**
* Ecommerce Dashboard
*/
import React, { Component } from 'react'
...
// GridList data
const tileData = [
{
img: require('Assets/img/gallery-1.jpg'),
title: 'Gallery 1',
author: 'author',
cols: 1.3,
},
...
{
img: require('Assets/img/gallery-4.jpg'),
title: 'Gallery 4',
author: 'author',
cols: .66,
}
]

export default class EcommerceDashboard extends Component {
...
return (
...
// Grid List Code
<div>
<GridList>
{tileData.map(tile => (
<GridListTile key={tile.img} cols={tile.cols || 1}>
<img src={tile.img} alt={tile.title} />
</GridListTile>
))}
</GridList>
</div>
</div>
</div>

Step 2: Now Import the component from its parent library.

import GridList from '@material-ui/core/GridList';
import GridListTile from '@material-ui/core/GridListTile';

We have given you an example of adding an image only grid list on the Ecommerce Dashboard.

You can check some other layouts of grid list below. For adding any of the below layout in the template, please check their relative code in the src->routes->components->grid-list->components folder.

Last Updated 5 years ago
Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages