GrapesJS Starter Minimal
Simplest way to create a Grapesjs example
by Andy Bulka
HTML
<script src="https://unpkg.com/grapesjs"></script>
<link rel="stylesheet" href="https://unpkg.com/grapesjs/dist/css/grapes.min.css">
<script src="https://unpkg.com/grapesjs-blocks-basic"></script>
<div id="gjs">
<p>
Hello world.
</p>
<p>
Drag me somewhere...
</p>
<p>
Bye bye world, nice simple example.
</p>
</div>
CSS
body, html {
margin: 0;
height: 100%;
}
Babel + JSX
const editor = grapesjs.init({
container: '#gjs',
fromElement: 1,
height: '100%',
storageManager: { type: 0 },
plugins: ['gjs-blocks-basic']
});
editor.on('component:add', (model) => {
console.log('Add');
});