Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Livewire Jodit Text Editor Laravel Package

mantix/livewire-jodit-text-editor

View on GitHub
Deep Wiki
Context7

📋 Table of Contents

✨ Introduction

A powerful Livewire rich text editor (WYSIWYG) component built on top of Jodit Editor, providing seamless integration with Laravel Livewire.

To use this package, you must have Livewire 3 or Livewire 4 installed.

📦 Installation

Install this package via Composer:

composer require mantix/livewire-jodit-text-editor

Include the Jodit Editor theme and the library in your layout or specific view:

<!-- Include Jodit CSS Styling -->
<link rel="stylesheet" href="//unpkg.com/jodit@4.1.16/es2021/jodit.min.css">

<!-- Include the Jodit JS Library -->
<script src="//unpkg.com/jodit@4.1.16/es2021/jodit.min.js"></script>

Or use NPM to install the Jodit Editor directly in your project:

npm install jodit

Import it in your app.js like:

// Jodit Editor
import 'jodit/esm/plugins/resizer/resizer'; // Resizer plugin is used when inserting images
import 'jodit/esm/plugins/video/video'; // Video plugin is used to insert videos
// Feel free to add extra plugins here...
import { Jodit } from 'jodit';
window.Jodit = Jodit;

And in your app.scss:

// Jodit Editor
@import 'jodit/es2021/jodit';

For additional information, refer to the Jodit Editor documentation.

🎬 Basic Usage

The simplest way to use the editor:

<livewire:jodit-text-editor wire:model.live="content" />

🚀 Advanced Features

Customizing Toolbar Buttons

You can customize the toolbar buttons by passing an array:

<livewire:jodit-text-editor 
    wire:model.live="content" 
    :buttons="['bold', 'italic', 'underline', 'strikeThrough', '|', 'left', 'center', 'right', '|', 'link', 'image']" 
/>

Using Multiple Editors

When using multiple editors on the same page, you can assign unique identifiers to target them individually:

<livewire:jodit-text-editor 
    wire:model.live="description" 
    identifier="description-editor" 
/>

<livewire:jodit-text-editor 
    wire:model.live="content" 
    identifier="content-editor" 
/>

Programmatically Updating Content

You can update editor content programmatically using Livewire's dispatch method:

Update all editors on the page:

// This will update all Jodit editors on the page
$this->dispatch('update-jodit-content', $newContent);

Update a specific editor:

// This will only update the editor with the specified identifier
$this->dispatch('update-jodit-content', ['description-editor', $newContent]);

🎨 Customization

The text editor component is entirely customizable. Publish the view file to customize it:

php artisan vendor:publish --tag=livewire-jodit-text-editor-views

After publishing, you can edit the view at resources/views/vendor/livewire-jodit-text-editor/livewire/jodit-text-editor.blade.php.

🔄 Changelog

Please see CHANGELOG for more information on what has changed recently.

🤝 Contributing

Please see CONTRIBUTING for details.

❤️ Support

Is this plugin helpful to you? Let me know by connecting on LinkedIn or on X.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
daikazu/eloquent-salesforce-objects
unseen-codes/chat
romalytar/yammi-jobs-monitoring-laravel
kisame76/filament-db-table-state
nqxcode/laravel-lucene-search
dpfx/laravel-livewire-wizards
workos/workos-php-laravel
sofa/laravel-global-scope
nawasara/auth-primitives
adhocrat-io/arkhe-main
make-dev/orca-harpoon
itsemon245/lamet
baks-dev/dashboard
amoifr/pickle-panther-bundle
make-dev/orca
dmstr/symfony-system-resources-bundle
dmstr/symfony-job-queue-bundle
dmstr/openapi-json-schema-bundle
dmstr/keycloak-security-bundle
dmstr/doctrine-audit-log-bundle