coderhouse4u-grapejs-slider
v1.0.2
Published
Slider
Downloads
9
Readme
Slider
HTML
<link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet">
<script src="https://unpkg.com/grapesjs"></script>
<script src="path/to/coderhouse4u-grapejs-slider/dist/index.js"></script>
<div id="gjs"></div>
JS
const editor = grapesjs.init({
container: '#gjs',
height: '100%',
fromElement: true,
storageManager: false,
plugins: ['slider'],
});
CSS
body, html {
margin: 0;
height: 100%;
}
Summary
- Plugin name:
coderhouse4u-grapejs-slider
Download
- NPM
npm i coderhouse4u-grapejs-slider
- GIT
git clone https://github.com/techtricks-mas/grapejs-slider.git
Usage
Directly in the browser
<link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet"/>
<script src="https://unpkg.com/grapesjs"></script>
<script src="path/to/coderhouse4u-grapejs-slider/dist/index.js"></script>
<div id="gjs"></div>
<script type="text/javascript">
var editor = grapesjs.init({
container: '#gjs',
// ...
plugins: ['slider'],
pluginsOpts: {
'slider': { /* options */ }
}
});
</script>
Modern javascript
import grapesjs from 'grapesjs';
import slider from 'coderhouse4u-grapejs-slider';
import 'grapesjs/dist/css/grapes.min.css';
const editor = grapesjs.init({
container : '#gjs',
// ...
plugins: [slider],
pluginsOpts: {
[slider]: { /* options */ }
}
// or
plugins: [
editor => slider(editor, { /* options */ }),
],
});
Development
Clone the repository
$ git clone https://github.com/YOUR-USERNAME/slider.git
$ cd slider
Install dependencies
$ npm i
Start the dev server
$ npm start
Build the source
$ npm run build
License
MIT