A workspace for your words

An open-source
rich text editor.

From the first sentence to the final document.
Rich text, precise tables and editable HTML —
in one JavaScript editor you can make your own.

WRITE. FORMAT. MAKE IT YOURS.JAVASCRIPT / HTML / CSS
01 / THE PLAYGROUND

Your next document starts here.

A real editor. Select text, try a tool,
or bring a document of your own.

Live, in your browser

Sample documents are editable. Your edits are kept when switching samples during this visit.

02 / THE TOOLKIT

Small details.
Well-crafted documents.

The tools you reach for every day,
with room to go further.

Less friction.
More expression.

Shape a paragraph, build a table or work directly with the markup. Keep your content in HTML from start to finish.

Explore the tool reference ↓
01

Type with intention

Font families, pixel sizes, colors, highlights, alignment and line spacing. Preview font choices on selected text.

02

Tables that do the work

Insert rows and columns, merge cells, adjust borders and resize your layout. Try the dedicated table workspace.

Open table workspace ↗
03

See both sides of your content

Move between visual editing and HTML source, with syntax highlighting and built-in code formatting.

04

Ready for real documents

Images, links, lists, page layout, find and replace, browser printing and HTML download, all within reach.

03 / BUILT TO FIT

Your application.
Your editor.

Add the stylesheet and script, choose an element and start editing. No API key or hosted editor account is required.

View JavaScript ↗View stylesheet ↓
index.html
<link rel="stylesheet" href="https://xoditor.rameshmaharjan.info.np/dist/xoditor.min.css">
<script src="https://xoditor.rameshmaharjan.info.np/dist/xoditor.min.js"></script>

<textarea id="editor"></textarea>
<script>
  const editor = new Xoditor('#editor', {
    height: '480px',
    defaultFont: 'Arial',
    stickyToolbar: false,
    autoSave: false
  });

  editor.setContent('<p>Make something good.</p>');
  const html = editor.getContent();
</script>
Plain JavaScript. HTML in, HTML out.
04 / THE FIELD GUIDE

A clear path from demo to app.

Getting started

Download the JavaScript and stylesheet above and serve them with your application. Copy the font stylesheet and its font files if you use the bundled Nepali fonts. The stylesheet and script are also available under /dist/ on this site.

Create a textarea or div, then pass its selector to new Xoditor(). Keep the returned instance to read or replace content.

Configuration

Option Example Purpose
height '480px' Editor height
defaultFont 'Arial' Starting font family
fonts ['Arial', 'Kalimati'] Font menu choices
toolbar ['bold', 'italic', 'link'] Core toolbar commands
ribbon true Ribbon layout
stickyToolbar false Toolbar scroll behavior
autoSave false Enable or disable local autosave
onChange (html, editor) => {} Receive content changes

Content API

editor.getContent()
Returns the current document as HTML.
editor.setContent(html)
Replaces the editor document.
editor.setReadOnly(true)
Changes the editing state.
editor.destroy()
Removes the editor when its host view is unmounted.

Know your tools

Use the toolbar in the playground to explore these groups. Hover over a button for its name.

Text & typography

Bold · Italic · Underline · Strikethrough · Subscript · Superscript · Fonts · Sizes · Text color · Highlight · Clear formatting

Paragraphs & structure

Alignment · Line spacing · Ordered lists · Bulleted lists · Indent · Outdent · Horizontal rule · Page break

Tables & media

Insert table · Rows & columns · Merge & split · Borders · Cell alignment · Resize · Image upload · Links

Document & source

Undo & redo · Find & replace · HTML source · Format HTML · Page layout · Print · Download HTML · Fullscreen · Zoom

A few things to know

Can I use it with React, Vue or another framework?

Use the JavaScript constructor after the host element mounts and call destroy() when it unmounts. These are manual integrations; this project does not ship dedicated framework packages.

What happens when I paste from Word?

The editor accepts rich HTML pasted from the clipboard. Complex Word layouts, fonts and pagination can differ in a browser. Check important documents before saving or printing.

Does the demo save my document to a server?

This playground has autosave disabled and does not submit document content to a server. Reloading the page resets it. Use HTML download to keep a copy.

How do I save content in my application?

Read HTML with getContent() and send it through your own API. Validate and sanitize HTML on your server before storing or displaying content from untrusted users.

Does printing create a server-side PDF?

The print tool opens the browser print flow. Saving as PDF depends on the browser. Server-side PDF generation is a separate integration.

THE NEXT PAGE IS YOURS

Put your words to work.

Open the editor ↑