Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jspaine/quill-placeholder-module

A quill module for adding placeholders
https://github.com/jspaine/quill-placeholder-module

module placeholder quill template

Last synced: about 1 month ago
JSON representation

A quill module for adding placeholders

Awesome Lists containing this project

README

        

# quill-placeholder-module
Quill module for adding placeholders. [Demo](https://codepen.io/jspaine/pen/MozyNp)
## Install
```
npm install --save quill-placeholder-module
```

## Usage
```js
import getPlaceholderModule from 'quill-placeholder-module'
// es5
var getPlaceholderModule = require('quill-placeholder-module').default
// umd
var getPlaceholderModule = PlaceholderModule.default

Quill.register('modules/placeholder', getPlaceholderModule(Quill, {
className: 'ql-placeholder-content' // default
}))

var quill = new Quill('#editor', {
modules: {
toolbar: {container: `#toolbar`},
placeholder: {
delimiters: ['{', '}'], // default
placeholders: [
{id: 'foo', label: 'Foo'},
{id: 'required', label: 'Required', required: true}
]
}
},
placeholder: 'Compose an epic...',
theme: 'snow' // or 'bubble'
});
```
Define the toolbar menu (a more complete example can be found in the [demo](https://codepen.io/jspaine/pen/MozyNp)):
```html



Foo
Required



```
And include the css from `dist/toolbar.css`.

The markup will contain (with default options) `...`

To transform the output check out https://github.com/jspaine/html-ast-transform