v2 working branch and v2 project board
pell is the simplest and smallest WYSIWYG text editor for web, with no dependencies
Live demo: https://jaredreich.com/pell
Comparisons
library | size (min+gzip) | size (min) | jquery | bootstrap | react | link |
---|---|---|---|---|---|---|
pell | 1.38kB | 3.54kB | https://github.com/jaredreich/pell | |||
squire | 16kB | 49kB | https://github.com/neilj/Squire | |||
medium-editor | 27kB | 105kB | https://github.com/yabwe/medium-editor | |||
quill | 43kB | 205kB | https://github.com/quilljs/quill | |||
trix | 47kB | 204kB | https://github.com/basecamp/trix | |||
ckeditor | 163kB | 551kB | https://ckeditor.com | |||
trumbowyg | 8kB | 23kB | x | https://github.com/Alex-D/Trumbowyg | ||
summernote | 26kB | 93kB | x | x | https://github.com/summernote/summernote | |
draft | 46kB | 147kB | x | https://github.com/facebook/draft-js | ||
froala | 52kB | 186kB | x | https://github.com/froala/wysiwyg-editor | ||
tinymce | 157kB | 491kB | x | https://github.com/tinymce/tinymce |
Features
- Pure JavaScript, no dependencies, written in ES6
- Easily customizable with the sass file (pell.scss) or overwrite the CSS
Included actions:
- Bold
- Italic
- Underline
- Strike-through
- Heading 1
- Heading 2
- Paragraph
- Quote
- Ordered List
- Unordered List
- Code
- Horizontal Rule
- Link
- Image
Other available actions (listed at https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand):
- Justify Center
- Justify Full
- Justify Left
- Justify Right
- Subscript
- Superscript
- Font Name
- Font Size
- Indent
- Outdent
- Clear Formatting
- Undo
- Redo
Or create any custom action!
Browser Support
- IE 9+ (theoretically, but good luck)
- Chrome 5+
- Firefox 4+
- Safari 5+
- Opera 11.6+
Installation
npm:
npm install --save pell
HTML:
... ... <!-- Bottom of body -->
Usage
API
// ES6// or
// Browserpell// orwindowpell
// Initialize pell on an HTMLElementpell // Execute a document command, see reference:// https://developer.mozilla.org/en/docs/Web/API/Document/execCommand// this is just `document.execCommand(command, false, value)`pell
List of overwriteable action names
- bold
- italic
- underline
- strikethrough
- heading1
- heading2
- paragraph
- quote
- olist
- ulist
- code
- line
- link
- image
Examples
General
HTML output:
const editor = // editor.content<HTMLElement>// To change the editor's content:editorcontentinnerHTML = '<b><u><i>Initial content!</i></u></b>'
Example (Markdown)
Markdown output:
const turndown = headingStyle: 'atx'
Frameworks
Custom Styles
SCSS
;// See all overwriteable variables in src/pell.scss // Then import pell.scss into styles: ;
CSS
/* After pell styles are applied to DOM: */
License
MIT
Credits
BrowserStack for cross browser testing: