Back

VibeFox JS Editor — Demo

Quick start

Plain HTML

The editor of the quick start with the full toolbar and the word count in the status bar. Type / in an empty line for the block menu, select text to format it.

Core concepts

Content

The content is HTML: the box under the editor shows getData(), the plain text and the counts after every change. The script, the event handler and the unsafe link of the initial HTML are removed by the sanitizer.

Creating and destroying

The buttons call the methods of the instance: replace the content, make it read only, change the height, destroy the editor and create it again.

Commands

Each button runs one command with exec() at the caret, as an undo step; the last button makes two inserts one step with transact(). Click into the text, then a button; Ctrl+Z undoes it.

Events

Every event handler receives one payload object; the list under the editor shows the latest events. Type, select text or press Ctrl+Z.

State snapshots

getState() is a JSON snapshot of the content and the view (here: the source mode and the find bar). Save, change something, then restore.

Writing and formatting

Typing helpers

Type @ for the mentions, / in an empty line for the block menu, # , - or **bold** for Markdown shortcuts, and quotes or -- for smart typography. The autosave event is shown under the editor.

Formatting options

The font and size menus of the toolbar list your own fonts and sizes; Tab nests a list item. The buttons open the special characters and emoji panels.

Paste

The button pastes the HTML of a Word document through cleanExternalHtml(): the list, heading and table stay, the Word styles go. Paste your own text from Word or Google Docs too.

Toolbar and modes

Toolbar

Your own toolbar layout in groups, with the HTML source view, the outline of the headings, focus mode and full screen at the end.

Classic, inline and balloon

Top: an inline editor keeps the look of the page and shows its toolbar above the block while editing. Bottom: a balloon editor shows a small toolbar at the selection and a "+" at an empty line. Click into the texts.

One toolbar for several editors

The title and the body are two inline editors under one toolbar: it works on the editor that has the focus.

Images, files and embeds

Uploads

The upload adapter here is a stub that only waits and shows the progress (a real one sends the file to your server). Click the button, pick a file with the toolbar, or drop an image into the text.

Embeds

A YouTube link becomes an embed without a network request: the editor shows a placeholder until the players are allowed to load (embed.live). Paste a YouTube or Vimeo link into an empty line too.

Tables

A table with a header row; the commands add a row below "Pro", merge two of its cells, color them and set the column widths. Drag a column border, right-click a cell for the table menu.

Find and replace

The find bar is open with a regular expression; the matches are highlighted. Click the buttons, or press Ctrl+F / Ctrl+H in the text.

Code blocks

Code blocks are colored by language: SQL, Python and an own INI language added with addCodeLanguage(). The chip on a block picks the language; type ```js and Enter for a new block.

Formulas

LaTeX formulas shown as MathML, inline and as a block. Click a formula to edit it in the dialog with a preview, or use the Σ button of the toolbar.

Track changes

Suggestion mode is on: the insertions and the deletion of Ann are colored, the panel on the side lists them. Type or delete text to add your own suggestions, accept or reject them in the panel.

Comments

A comment thread of Bob with a reply of Ann is attached to the sentence; the panel shows the threads. Select other text and press Ctrl+Alt+M (or the comment button) to add one.

Versions and comparison

Two saved versions compared side by side: deleted words of the draft on the left, inserted ones on the right. The buttons switch the view and restore the draft.

Real-time collaboration

Ann and Bob edit one document in two editors; the transport here is a small relay in the page instead of a server. Type in one editor: the text, the cursor and the name tag appear in the other.

Import and export

HTML and Markdown

The buttons download the document as HTML or Markdown, show the Markdown under the editor and import Markdown with a task list and a table.

PDF

The PDF is made in the browser: vector pages with selectable text, a header and page numbers. Click the button to download it.

Word (.docx)

The document with a suggestion and a comment downloads as a Word file with real revisions and comments; "Import" reads the .docx back into the editor.

Page view and printing

The document on Letter sheets with a header, page numbers and a page break, at 60% zoom. Press Ctrl+Enter for another page break; "Print" prints the sheets.

AI assistant

The adapter here is a stub model in the page that streams ready answers (a real one calls your model). Click "Summarize", or select a sentence and use the AI button of the toolbar (Ctrl+J), then accept or discard the answer.

Accessibility checker

The panel lists the problems of the document: an image without alt text, a skipped heading level, a vague link. Click an issue to go to it, or use its quick fix.

Own blocks and inline nodes

A "callout" block and a "kbd" inline node registered by the page, with their toolbar buttons and slash entries. Click into a paragraph and use the Callout button, or type /callout.

Theming and styling

Themes

The list switches the theme of the editor: the built-in light, dark and high-contrast themes and the themes of vibefox-js-themes.css, plus an own theme "brand".

CSS variables

One rule for all VibeFox JS components (accent and radius) and one for this editor only (toolbar background, padding and font size of the text).

Ready-made styles

The list switches the ready-made styles: classic, minimal and floating.

Density and size

The lists set data-vfjs-density on the container and the scale --vfjs-size-unit: the toolbar buttons and paddings follow.

Your own CSS

Plain CSS rules of the page change the active toolbar buttons and the headings, without !important. Put the caret into the bold word to see the active button.

Localization and RTL

Languages

The editor in Russian, with the language pack vibefox-js-editor.ru.js loaded after the library: the tooltips, menus, the placeholder and the status bar. The list switches the language of this editor.

Adding a language

A partial German dictionary: the placeholder, the status bar and some tooltips are German, the missing keys fall back to English.

Right-to-left

A right-to-left document: the toolbar, lists and quotes are mirrored; the toolbar has the buttons for left-to-right and right-to-left paragraphs. The last paragraph is left-to-right.

Using with other VibeFox JS libraries

Connecting components with link()

The counts of the editor go to a VibeFox JS Grid table with link() (both libraries are on this page). Type in the editor and watch the table.

AI tools

The buttons call the tools of the editor as a model would: read the content as Markdown, replace a word, and run kit.ask() with a stub model that asks for one tool call. The results are shown under the editor.

Bug Report

Thank you for helping us improve. We carefully review every report, but we do not reply to them individually. If your report leads to a change, it will be listed in the product changelog together with the report number. To discuss something in detail, please open a support ticket.

Slide to fit the puzzle