Last active
January 22, 2018 08:57
-
-
Save wschenk/a343ab5643bf8814ae4b00a0a670a45b to your computer and use it in GitHub Desktop.
create-react-app grid.js rmwc example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react' | |
import { | |
GridList, | |
GridTile, | |
GridTilePrimary, | |
GridTilePrimaryContent, | |
GridTileSecondary, | |
GridTileTitle } from 'rmwc' | |
class Grid extends Component { | |
render() { | |
return ( | |
<GridList tileAspect={'1x1'} > | |
{Array(10).fill().map((val, i) => ( | |
<GridTile key={i}> | |
<GridTilePrimary> | |
<GridTilePrimaryContent> | |
<img src="https://material-components-web.appspot.com/images/1-1.jpg" alt="test" /> | |
</GridTilePrimaryContent> | |
</GridTilePrimary> | |
<GridTileSecondary> | |
<GridTileTitle>Tile {i + 1}</GridTileTitle> | |
</GridTileSecondary> | |
</GridTile> | |
))} | |
</GridList> | |
) | |
} | |
} | |
export default Grid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment