Angular Material flex layout attributes without all the other stuff. Prefixed with data-
for react.
npm install react-material-layout
bower install react-material-layout
// You can either build css with webpack, or simply link in the HTML
// HTML link:
// <link rel="stylesheet" href="https://raw.githubusercontent.com/billjohnston/react-material-layout/master/dist/react-material-layout.min.css">
// Webpack:
// import 'react-material-layout/dist/react-material-layout.min.css'
class FlexboxTest extends React.Component{
render() {
return (
<div data-flex data-layout="column" data-layout-align="space-between">
<div data-flex data-layout="row" data-layout-align="space-between">
<div className="blue-box">1</div>
<div className="blue-box">2</div>
<div className="blue-box">3</div>
</div>
<div data-flex data-layout="row" data-layout-align="space-around center">
<div className="blue-box">1</div>
<div className="blue-box">2</div>
<div className="blue-box">3</div>
</div>
<div data-flex data-layout="row" data-layout-align="start center">
<div className="blue-box">1</div>
<div className="blue-box">2</div>
<div className="blue-box">3</div>
</div>
<div data-flex data-layout="row" data-layout-align="end center">
<div className="blue-box">1</div>
<div className="blue-box">2</div>
<div className="blue-box">3</div>
</div>
</div>
)
}
}
React.render(<FlexboxTest />, document.getElementById('container'))
Docs (remember to prefix all attributes with data-
)
// HTML link:
// <link rel="stylesheet" href="https://raw.githubusercontent.com/billjohnston/react-material-layout/master/dist/react-material-class-layout.min.css">
// Webpack:
// import 'react-material-layout/dist/react-material-class-layout.min.css'
class FlexboxTest extends React.Component{
render() {
return (
<div className="flex layout-column layout-align-space-between">
<div className="flex layout-row layout-align-space-between">
<div className="blue-box">1</div>
<div className="blue-box">2</div>
<div className="blue-box">3</div>
</div>
<div className="flex layout-row layout-align-space-around-center">
<div className="blue-box">1</div>
<div className="blue-box">2</div>
<div className="blue-box">3</div>
</div>
<div className="flex layout-row layout-align-start-center">
<div className="blue-box">1</div>
<div className="blue-box">2</div>
<div className="blue-box">3</div>
</div>
<div className="flex layout-row layout-align-end-center">
<div className="blue-box">1</div>
<div className="blue-box">2</div>
<div className="blue-box">3</div>
</div>
</div>
)
}
}
React.render(<FlexboxTest />, document.getElementById('container'))
Docs (use classes instead of attributes)
npm run build
You will be prompted for a release version (currently 1.1.7)