angular-bricklayer
AngularJS module for ademilter's bricklayer, a lightweight & independent cascading grid layout library
Demos
Installation
-
Install via either bower, npm or downloaded files:
- via bower:
bower install --save angular-bricklayer
- via npm:
npm install --save angular-bricklayer
- via downloaded files
-
Include dependencies and angular-bricklayer in your HTML.
- When using bower
<link rel="stylesheet" href="bower_components/bricklayer/dist/bricklayer.min.css">
<script src="bower_components/bricklayer/dist/bricklayer.min.js"></script>
<script src="bower_components/angular-bricklayer/dist/angular-bricklayer.min.js"></script>
- When using npm
<link rel="stylesheet" href="node_modules/bricklayer/dist/bricklayer.min.css">
<script src="node_modules/bricklayer/dist/bricklayer.min.js"></script>
<script src="node_modules/angular-bricklayer/dist/angular-bricklayer.min.js"></script>
- When using downloaded files
<link rel="stylesheet" href="YOUR_PATH/bricklayer.min.css">
<script src="YOUR_PATH/bricklayer.min.js"></script>
<script src="YOUR_PATH/angular-bricklayer.min.js"></script>
-
Add jtt_bricklayer
to your application's module dependencies.
Usage
<div class="bricklayer">
<div>Your item</div>
<div>Your another item</div>
<div>Your another but long item</div>
<div>Your another but very short item</div>
<div>Your one more item</div>
<div>Your smallest item</div>
</div>
- Define bricklayer column size:
@media screen and (min-width: 1200px) {
.bricklayer-column-sizer {
width: 33.3%;
}
}
@media screen and (min-width: 768px) {
.bricklayer-column-sizer {
width: 50%;
}
}
Add bricks dynamically
Use bricklayer-append
or bricklayer-prepend
as attribute, class or element name inside of your bricklayer
instance
<div class="bricklayer">
<div bricklayer-append ng-repeat="item in appendData"></div>
<div bricklayer-prepend ng-repeat="item in prependData"></div>
</div>
License
MIT