- TypeScript 90.1%
- HTML 5.6%
- CSS 3.9%
- JavaScript 0.4%
Hi, I'm making updates for Open Collective. Either you or a supporter signed this repo up for Open Collective. This pull request adds backers and sponsors from your Open Collective https://opencollective.com/editorjs❤️ It adds two badges at the top to show the latest number of backers and sponsors. It also adds placeholders so that the avatar/logo of new backers/sponsors can automatically be shown without having to update your README.md. [more info](https://github.com/opencollective/opencollective/wiki/Github-banner). See how it looks on this [repo](https://github.com/apex/apex#backers). You can also add a postinstall script to let people know after npm|yarn install that you are welcoming donations (optional). [More info](https://github.com/OpenCollective/opencollective-cli) You can also add a "Donate" button to your website and automatically show your backers and sponsors there with our widgets. Have a look here: https://opencollective.com/widgets P.S: As with any pull request, feel free to comment or suggest changes. The only thing "required" are the placeholders on the README because we believe it's important to acknowledge the people in your community that are contributing (financially or with code!). Thank you for your great contribution to the open source community. You are awesome! 🙌 And welcome to the open collective community! 😊 Come chat with us in the #opensource channel on https://slack.opencollective.com - great place to ask questions and share best practices with other open source sustainers! |
||
|---|---|---|
| dist | ||
| docs | ||
| example | ||
| src | ||
| types | ||
| .babelrc | ||
| .editorconfig | ||
| .eslintrc | ||
| .gitignore | ||
| .gitmodules | ||
| .npmignore | ||
| .postcssrc.yml | ||
| .stylelintrc | ||
| CODEOWNERS | ||
| LICENSE | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| tslint.json | ||
| webpack.config.js | ||
| yarn.lock | ||

Version 2.0 is here!
We are glad to introduce the next version of Editor.js. Totally new core, structure and plugins — that was an impressive adventure 🤓.
Join public Telegram-chat or Gitter-channel where you can always find a support.
Browsers support
![]() IE / Edge |
![]() Firefox |
![]() Chrome |
![]() Safari |
![]() iOS Safari |
![]() Opera |
|---|---|---|---|---|---|
| Edge 12+ | Firefox 18+ | Chrome 49+ | Safari 10+ | Safari 10+ | Opera 36+ |
Documentation
While we develop the new Documentation Site with all stuff, you can check some available docs at the docs/ dir.
- Installation
- How to use
- How to create a Block Tool Plugin
- How to create an Inline Tool Plugin
- API for Tools
Sorry if we missed something. You can join a Telegram-chat and ask a question.
So how to use Editor.js
Basics
Editor.js is a Block-Styled editor. Blocks are structural units, of which the Entry is composed.
For example, Paragraph, Heading, Image, Video, List are Blocks. Each Block is represented by Plugin.
We have many ready-to-use Plugins and a simple API for creating new ones.
So how to use the Editor after Installation.
- Create new Blocks by Enter or with the Plus Button
- Press
TABor click on the Plus Button to view the Toolbox - Press
TABagain to leaf Toolbox and select a Block you need. Then press Enter.
- Select text fragment and apply a style or insert a link from the Inline Toolbar
- Use «three-dots» button on the right to open Block Settings. From here, you can move and delete a Block or apply Tool's settings, if it provided. For example, set a Heading level or List style.
Shortcuts
We really appreciate shortcuts. So there are few presets.
| Shortcut | Action | Restrictions |
|---|---|---|
TAB |
Show/leaf a Toolbox. | On empty block |
SHIFT+TAB |
Leaf back a Toolbox. | While Toolbox is opened |
ENTER |
Create a Block | While Toolbox is opened and some Tool is selected |
CMD+B |
Bold style | On selection |
CMD+I |
Italic style | On selection |
CMD+K |
Insert a link | On selection |
Also we support shortcuts on the all type of Tools. Specify a shortcut with the Tools configuration. For example:
var editor = EditorJS({
//...
tools: {
header: {
class: Header,
shortcut: 'CMD+SHIFT+H'
},
list: {
class: List,
shortcut: 'CMD+SHIFT+L'
}
}
//...
});
Installation Guide
There are few steps to run Editor.js on your site.
Load Editor's core
Firstly you need to get Editor.js itself. It is a minified script with Editor's core and some default must-have tools.
Choose the most usable method of getting Editor for you.
- Node package
- Source from CDN
- Local file from project
Node.js
Install the package via NPM or Yarn
npm i @editorjs/editorjs --save-dev
Include module in your application
const EditorJS = require('@editorjs/editorjs');
Use from CDN
You can load specific version of package from jsDelivr CDN.
https://cdn.jsdelivr.net/npm/@editorjs/editorjs@latest
Then require this script.
<script src="..."></script>
Save sources to project
Copy editor.js file to your project and load it.
<script src="editor.js"></script>
Load Tools
Each Block at the Editor.js represented by Tools. There are simple external scripts with own logic. Probably you want to use several Block Tools that should be connected.
For example check out our Header Tool that represents heading blocks.
You can install Header Tool by the same way as the Editor (Node.js, CDN, local file).
Check Editor.js's community to see more ready-to-use Tools.
Example: use Header from CDN
<script src="https://cdn.jsdelivr.net/npm/codex.editor.header@2.0.4/dist/bundle.js"></script>
Create Editor instance
Create an instance of Editor.js and pass Configuration Object with holderId and tools list.
<div id="editorjs"></div>
You can create a simple Editor with only default Paragraph Tool by passing a string with element's Id (wrapper for Editor) as a configuration param. Or use the default editorjs id for wrapper.
var editor = new EditorJS(); /** Zero-configuration */
// equals
var editor = new EditorJS('editorjs');
Or pass a whole settings object.
var editor = new EditorJS({
/**
* Create a holder for the Editor and pass its ID
*/
holderId : 'editorjs',
/**
* Available Tools list.
* Pass Tool's class or Settings object for each Tool you want to use
*/
tools: {
header: {
class: Header,
inlineToolbar : true
},
// ...
},
/**
* Previously saved data that should be rendered
*/
data: {}
});
Saving Data
Call editor.saver.save() and handle returned Promise with saved data.
editor.saver.save()
.then((savedData) => {
console.log(savedData);
});
Example
Take a look at the example.html to view more detailed examples.
Changelog
See a whole Changelog
Credits and references
- We use HTMLJanitor module in our Sanitizer module.
About team
We are CodeX and we build products for developers and makers.
Follow us on Twitter: twitter.com/codex_team
Feel free to contact: team@codex.so
Support project improvements
Love Editor.js? Please consider supporting our collective: 👉 https://opencollective.com/editorjs
Contributors
This project exists thanks to all the people who contribute.
Backers
Thank you to all our backers! 🙏 [Become a backer]
Sponsors
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]








