Wysi

The lightweight, dependency-free WYSIWYG editor that just works. Built with vanilla JavaScript, perfect for modern web applications.

Why Choose Wysi?

Lightweight

Only 12KB minified and gzipped. No bloat, just the features you need for rich text editing.

Zero Dependencies

Built with vanilla ES6. No jQuery, no React, no framework required. Works everywhere.

Customizable

Dark mode support, auto-grow, auto-hide toolbar, and extensive configuration options.

Content Filtering

Smart paste filtering ensures clean, consistent content from any source.

Cross-Platform

Works seamlessly on all modern browsers, desktop and mobile devices.

Developer Friendly

Simple API, easy integration. Convert any textarea element into a full featured HTML editor.

Interactive Demo

Experience Wysi in action. Try formatting text, adding links, and exploring all the features.

Get Started in Seconds

Simple setup for a quick start. Add Wysi to your project with just a few lines of code.

Installation
<!-- Include Wysi CSS and JS -->
<link rel="stylesheet" href="wysi.min.css"/>
<script src="wysi.min.js"></script>

<!-- Or from CDN (not recommended in production) -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/mdbassit/Wysi@latest/dist/wysi.min.css"/>
<script src="https://cdn.jsdelivr.net/gh/mdbassit/Wysi@latest/dist/wysi.min.js"></script>
Basic Usage
<textarea id="my-editor"></textarea>

<script>
// Initialize Wysi
Wysi({
    el: '#my-editor'
});

// Get content
const content = document.querySelector('#my-editor').value;
</script>
Advanced Configuration
Wysi({
    el: '.richtext',
    darkMode: true,
    height: 300,
    autoGrow: true,
    autoHide: false,
    tools: [
        'format', '|', 
        'bold', 'italic', 'underline', 'strike', '|', 
        { label: 'Text alignment', items: ['alignLeft', 'alignCenter', 'alignRight', 'alignJustify'] }, '|', 
        'ul', 'ol', '|', 
        'indent', 'outdent', '|', 
        'link', 'image', 'hr', 'quote', '|', 
        'removeFormat'
    ],
    onChange: (content) => {
        console.log('Content changed:', content);
        // Save to server, update preview, etc.
    }
});