https://github.com/featurist/hyperdom-draggabilly
A hyperdom component that makes elements draggable
https://github.com/featurist/hyperdom-draggabilly
Last synced: about 2 months ago
JSON representation
A hyperdom component that makes elements draggable
- Host: GitHub
- URL: https://github.com/featurist/hyperdom-draggabilly
- Owner: featurist
- Created: 2015-07-11T04:41:38.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-12-06T12:38:54.000Z (over 8 years ago)
- Last Synced: 2025-03-02T05:43:08.026Z (2 months ago)
- Language: HTML
- Homepage:
- Size: 40 KB
- Stars: 1
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hyperdom-draggabilly
A [hyperdom](https://github.com/featurist/hyperdom) component that makes elements
draggable using [draggabilly](https://github.com/desandro/draggabilly).[Demo](http://www.featurist.co.uk/hyperdom-draggabilly/)
## Example
```JavaScript
var hyperdom = require('hyperdom');
var draggable = require('hyperdom-draggabilly');
var h = hyperdom.html;function render(model) {
return h('.page',
draggable(h('.red', 'Animal')),
draggable({ grid: [20, 20] }, h('.green', 'Vegetable')),
draggable({ axis: 'x' }, h('.blue', 'Mineral'))
);
}hyperdom.append(document.body, render, {});
```## License
MIT