Skip to content

Repository files navigation

aurelia-gridstack

Aurelia 2 wrapper for GridStack.

Demo app

Installation

npm install aurelia-gridstack gridstack

Configuration

import Aurelia from 'aurelia';
import { GridStackConfiguration } from 'aurelia-gridstack';
import { App } from './app';

Aurelia
  .register(GridStackConfiguration)
  .app(App)
  .start();

Usage

<require from="gridstack/dist/gridstack.min.css"></require>
<grid-stack min-row="5" float>
  <grid-stack-item x="0" y="0" w="2" h="1">
    <div class="item">Item1</div>
  </grid-stack-item>
  <grid-stack-item x="1" y="1" w="2" h="2" min-w="2" min-h="2">
    <div class="item">Item2</div>
  </grid-stack-item>
  <grid-stack-item x="3" y="2" w="1" h="2">
    <div class="item">Item3</div>
  </grid-stack-item>
</grid-stack>

Or with bindings
<grid-stack min-row="5" float>
  <grid-stack-item repeat.for="i of items" x.bind="i.x" y.bind="i.y" w.bind="i.w" h.bind="i.h">
    <div class="item">
      <div>Item ${$index + 1}</div>
      <div>x: ${i.x}</div>
      <div>y: ${i.y}</div>
      <div>w: ${i.w}</div>
      <div>h: ${i.h}</div>
    </div>
  </grid-stack-item>
</grid-stack>
items = [
  { x: 0, y: 0, w: 2, h: 1 },
  { x: 1, y: 1, w: 2, h: 2 },
  { x: 3, y: 2, w: 1, h: 2 }
];

Contribution

npm install
npm start

Use npm run build to build the plugin and npm run lint to lint the TypeScript sources.

Releases

Packages

Used by

Contributors

Languages