Coder Social home page Coder Social logo

material-app-layout's Introduction

Material App Layout

Providing a material layout for your react app in mere seconds. Built- and matches well with Material-UI

Hello Component!

npm install material-app-layout

import Layout from 'material-app-layout'; 

class App extends Component {
  render() {
    return <Layout/>
  }
}

Clean image

How it works

Available props:

  1. top
  2. menu
  3. main

That's it.

They may be filled with whatever you want!

Example

Content

Clean in menu

import React, { Component } from 'react';

import Layout from 'material-app-layout'; 
import { Typography, List, ListItem, Avatar, ListItemText } from '@material-ui/core';
import GridList from '@material-ui/core/GridList';
import GridListTile from '@material-ui/core/GridListTile';

import ImageIcon from '@material-ui/icons/Image';
import WorkIcon from '@material-ui/icons/Work';
import BeachAccessIcon from '@material-ui/icons/BeachAccess';

import { withStyles } from '@material-ui/core/styles';

const styles = theme => ({
  root: {
    display: 'flex',
    flexWrap: 'wrap',
    justifyContent: 'space-around',
    overflow: 'hidden',
    backgroundColor: theme.palette.background.paper,
  },
  gridList: {
    width: 500,
    height: 450,
  },
  subheader: {
    width: '100%',
  },
});

const tileData = [
  {
    img: "https://upload.wikimedia.org/wikipedia/commons/thumb/c/c4/%21931_Factory_Built._English_Electric._%282%29_%288068911909%29.jpg/1599px-%21931_Factory_Built._English_Electric._%282%29_%288068911909%29.jpg", 
    cols: 3
  }, 
  {
    img: "https://upload.wikimedia.org/wikipedia/commons/c/c4/Bubba_N_Main.jpg", 
    cols: 2
  }, 
  {
    img: "https://upload.wikimedia.org/wikipedia/commons/thumb/d/d0/Bubble_Nebula_%2830847619376%29.jpg/240px-Bubble_Nebula_%2830847619376%29.jpg", 
    cols: 1
  }, 
  {
    img: "https://upload.wikimedia.org/wikipedia/commons/a/af/BubbleChamber-fnal_2.png", 
    cols: 1
  }, 
  {
    img: "https://upload.wikimedia.org/wikipedia/commons/thumb/3/36/Bubbles_-_Studley_Royal_Park_-_North_Yorkshire%2C_England_-_DSC00837.jpg/240px-Bubbles_-_Studley_Royal_Park_-_North_Yorkshire%2C_England_-_DSC00837.jpg", 
    cols: 2
  }
]
class App extends Component {
  render() {
    const { classes } = this.props;
    return <Layout 
      top={
        <Typography variant="display1">Welcome!</Typography>
      }
      menu={
        <List>
          <ListItem>
            <Avatar>
              <ImageIcon />
            </Avatar>
            <ListItemText primary="Photos" secondary="Jan 9, 2014" />
          </ListItem>
          <ListItem>
            <Avatar>
              <WorkIcon />
            </Avatar>
            <ListItemText primary="Work" secondary="Jan 7, 2014" />
          </ListItem>
          <ListItem>
            <Avatar>
              <BeachAccessIcon />
            </Avatar>
            <ListItemText primary="Vacation" secondary="July 20, 2014" />
          </ListItem>
        </List>
      }
      main={
        <GridList cellHeight={160} className={classes.gridList} cols={3}>
          {tileData.map(tile => (
            <GridListTile key={tile.img} cols={tile.cols || 1}>
              <img src={tile.img} alt={tile.title} />
            </GridListTile>
          ))}
        </GridList>
      }
    />
  }
}

export default withStyles(styles)(App);

material-app-layout's People

Contributors

olaven avatar

Stargazers

Markus Archer Goulden Dreyer avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.