# Grid List

You can add the component on any page in the template. You need to follow the steps given below:&#x20;

**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-2.jpg'),
		title: 'Gallery 2',
		author: 'author',
		cols: .7,
	 },
	 {
		img: require('Assets/img/gallery-3.jpg'),
		title: 'Gallery 3',
		author: 'author',
		cols: .66,
	 },
	 {
		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.

![](https://3423697845-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEnOfkACC-WsXr2rO7I%2F-LbweM5JhxrD9eF7AqeH%2F-Lbwf-jg0dTf8cRclqzt%2FSelection_039.png?alt=media\&token=43402471-39f7-4f7a-8563-95c152d61557)

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.

![](https://3423697845-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEnOfkACC-WsXr2rO7I%2F-LbvN6B07613ig8EZ-kb%2F-LbvOpaAXPqKWwYahsjp%2FScreenshot%202019-04-08%20at%2010.15.21%20AM.png?alt=media\&token=b4d3dc46-3c45-44a3-923d-32554b0272da)

![](https://3423697845-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEnOfkACC-WsXr2rO7I%2F-LbvN6B07613ig8EZ-kb%2F-LbvOrYvzQ_Z21ml5m-R%2FScreenshot%202019-04-08%20at%2010.15.31%20AM.png?alt=media\&token=e5238947-1abf-426f-8d77-a12e5ba3abb5)

![](https://3423697845-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEnOfkACC-WsXr2rO7I%2F-LbvN6B07613ig8EZ-kb%2F-LbvOta4q_jW2nwlLaZF%2FScreenshot%202019-04-08%20at%2010.15.45%20AM.png?alt=media\&token=e935a7d7-332d-433a-b4b4-e1f9a8200acb)
