# grapesjs-undraw

> Grapesjs Undraw

Latest version **1.0.2** (published 2023-08-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install grapesjs-undraw
pnpm add grapesjs-undraw
yarn add grapesjs-undraw
bun add grapesjs-undraw
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2023-08-07 |
| First published | 2023-05-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 303.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Maintainers | ju99ernaut |
| Keywords | grapesjs, plugin |

## Links

- npm: https://www.npmjs.com/package/grapesjs-undraw
- Repository: https://github.com/Ju99ernaut/grapesjs-undraw
- Homepage: https://github.com/Ju99ernaut/grapesjs-undraw#readme
- Issues: https://github.com/Ju99ernaut/grapesjs-undraw/issues
- npm.io page: https://npm.io/package/grapesjs-undraw

## Recent versions

- 1.0.2 (latest) — 2023-08-07
- 1.0.1 — 2023-05-24

## README

# Grapesjs Undraw

Add undraw illustrations through a modal

[DEMO](#)

### HTML
```html
<link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet">
<link href="https://unpkg.com/grapesjs-undraw/dist/grapesjs-undraw.min.css" rel="stylesheet">
<script src="https://unpkg.com/grapesjs"></script>
<script src="https://unpkg.com/grapesjs-undraw"></script>

<div id="gjs"></div>
```

### JS
```js
const editor = grapesjs.init({
  container: '#gjs',
  height: '100%',
  fromElement: true,
  storageManager: false,
  plugins: ['grapesjs-undraw'],
});
```

### CSS
```css
body, html {
  margin: 0;
  height: 100%;
}
```


## Summary

* Plugin name: `grapesjs-undraw`
* Commands
    * `undraw`
* API
    * `editor.Undraw`



## Options

| Option | Description | Default |
|-|-|-
| `undrawEndpoint` | Endpoint for undraw svgs(can be self hosted) | `https://42f2671d685f51e10fc6-b9fcecea3e50b3b59bdc28dead054ebc.ssl.cf5.rackcdn.com/illustrations/` |
| `undrawError` | Handle errors | `check source` |
| `modalUndrawTitle` | Modal title | `Undraw` |

## Download

* CDN
  * `https://unpkg.com/grapesjs-undraw`
* NPM
  * `npm i grapesjs-undraw`
* GIT
  * `git clone https://github.com/Ju99ernaut/grapesjs-undraw.git`



## Usage

Directly in the browser
```html
<link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet"/>
<link href="https://unpkg.com/grapesjs-undraw/dist/grapesjs-undraw.min.css" rel="stylesheet">
<script src="https://unpkg.com/grapesjs"></script>
<script src="path/to/grapesjs-undraw.min.js"></script>

<div id="gjs"></div>

<script type="text/javascript">
  var editor = grapesjs.init({
      container: '#gjs',
      // ...
      plugins: ['grapesjs-undraw'],
      pluginsOpts: {
        'grapesjs-undraw': { /* options */ }
      }
  });
</script>
```

Modern javascript
```js
import grapesjs from 'grapesjs';
import plugin from 'grapesjs-undraw';
import 'grapesjs/dist/css/grapes.min.css';
import 'grapesjs-undraw/dist/grapesjs-undraw.min.css'

const editor = grapesjs.init({
  container : '#gjs',
  // ...
  plugins: [plugin],
  pluginsOpts: {
    [plugin]: { /* options */ }
  }
  // or
  plugins: [
    editor => plugin(editor, { /* options */ }),
  ],
});
```



## Development

Clone the repository

```sh
$ git clone https://github.com/Ju99ernaut/grapesjs-undraw.git
$ cd grapesjs-undraw
```

Install dependencies

```sh
$ npm i
```

Watch sass

```sh
$ npm run watch:scss
```

Start the dev server

```sh
$ npm start
```

Build the source

```sh
$ npm run build
```

Build css

```sh
$ npm run build:css
```

## License

MIT

---
_Source: https://npm.io/package/grapesjs-undraw · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
