Reactify
  • Introduction
  • Folder Structure
  • Reactify Redux Thunk/Saga
    • Installation
    • Different Layouts
      • Adding Menu/Component In Different Layouts
    • Adding Widgets
    • Build an App from Scratch
    • Seed Project
    • Themes
    • Authentication
    • Translate The App(Multi Language Support)
    • UI Components
      • Alerts
      • App Bar
      • Avatars
      • Badges
      • Bottom Navigation
      • Buttons
      • Cards
      • Card Masonary
      • Chip
      • Dialogs
      • Divider
      • Drawers
      • Expansion Panel
      • Grid List
      • List
      • Menu
      • Pop Over & ToolTip
      • Progress
      • Snackbar
      • Selection Controls
    • Style Customization
    • Create a Docker Image
    • Instant Search With Algolia
    • Deployment
  • Reactify Laravel
    • Folder Structure
    • Installation Reactify Laravel
  • FAQ's(Frequently Asked Questions)
  • Credits
  • Changelog
  • Customer Support
Powered by GitBook
On this page
  1. Reactify Redux Thunk/Saga
  2. UI Components

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-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.

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.

PreviousExpansion PanelNextList

Last updated 6 years ago