A powerful rich text editor custom component for Retool built with Editor.js, providing a modern WYSIWYG editing experience with clean JSON output.
- Block-Style Editing: Create structured content with various block types
- Clean JSON Output: All content is stored as structured JSON data
- Customizable Styling: Change background and text colors
- Dynamic Tool Configuration: Enable/disable specific formatting tools as needed
- Rich Formatting Tools:
- Headers (H1-H4)
- Lists (ordered and unordered)
- Quotes
- Code blocks
- Checklists
- Tables
- Embeds (YouTube, CodePen)
- Inline formatting (marker, underline, inline code)
- Delimiters
- Warnings
- Footnotes
- Links
-
Clone this repository:
git clone https://github.com/StackdropCO/editorjs-retool-component.git
-
Install dependencies:
npm install
-
Log in to Retool:
npx retool-ccl login
Note: You'll need an API access token with read and write scopes for Custom Component Libraries.
-
Create a component library:
npx retool-ccl init
-
Start development mode:
npx retool-ccl dev
-
Deploy your component:
npx retool-ccl deploy
-
Switch component versions:
To pin your app to the component version you just published, navigate to the Custom Component settings in your Retool app and change dev to the latest version. This may require you to refresh the page to see the newly published version.
The component exposes the following properties in Retool:
| Property | Type | Description |
|---|---|---|
content |
String | The current editor content as JSON string |
backgroundColor |
String | Background color of the editor (defaults to #f8fafc) |
textColor |
String | Text color in the editor (defaults to #000) |
Each formatting tool can be enabled or disabled independently through Retool's inspector panel:
| Tool Property | Type | Description |
|---|---|---|
enableHeader |
Boolean | Enable/disable header formatting |
enableList |
Boolean | Enable/disable list formatting |
enableQuote |
Boolean | Enable/disable quote blocks |
enableChecklist |
Boolean | Enable/disable checklist blocks |
enableCode |
Boolean | Enable/disable code blocks |
enableInlineCode |
Boolean | Enable/disable inline code formatting |
enableMarker |
Boolean | Enable/disable marker/highlight formatting |
enableDelimiter |
Boolean | Enable/disable delimiter blocks |
enableEmbed |
Boolean | Enable/disable embed blocks |
enableTable |
Boolean | Enable/disable table blocks |
enableWarning |
Boolean | Enable/disable warning blocks |
enableLink |
Boolean | Enable/disable link tool |
enableUnderline |
Boolean | Enable/disable underline formatting |
enableFootnotes |
Boolean | Enable/disable footnotes |
- Drag the Editor.js component onto your Retool canvas
- Configure the component settings:
- Set
backgroundColorandtextColorif desired - Connect
contentto load existing content - Enable/disable specific formatting tools as needed
- Set
- The
contentproperty serves as both input and output:- To load content: Set the
contentproperty to your existing JSON data - To save content: The component will automatically update the
contentproperty as the user types
- To load content: Set the
- You can use the
contentvalue in queries to save to your database
Editor.js outputs structured JSON data. Example output:
{
"time": 1635603431943,
"blocks": [
{
"id": "12345",
"type": "header",
"data": {
"text": "Editor.js",
"level": 2
}
},
{
"id": "67890",
"type": "paragraph",
"data": {
"text": "This is a paragraph block."
}
}
],
"version": "2.23.2"
}- Node.js >= 20.0.0
- Retool developer account
- Run
npm installto install dependencies - Make changes to the component in the
srcdirectory - Test your changes using the development mode
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
Created by Stackdrop

