Skip to content

Modules

Concept

Modules are functional extensions that enhance the capabilities of the Quill editor beyond simple text formatting. They allow you to add interactive features, modify event handling, or integrate external tools.

  • Goal: To provide business logic or complex functionality (e.g., resizing images, counting words, voice dictation, managing undo history).
  • How it works: A module is loaded when the editor starts. It can interact with the Quill API, listen to events (keystrokes, selection changes),
  • manipulate the editor's DOM, or add interface elements.

Note: This bundle provides several custom modules that do not exist natively in QuillJS (like ReadTimeModule, STTModule, FullScreenModule, etc.), offering advanced features out of the box.


  • You can add/customize quill modules in this option field.
  • You can create your own modules classes, they need to implement the ModuleInterface and add the name and options properties.
  • Some modules are automatically loaded when they are needed in fields.

Example of how to use modules:

php
use Ehyiah\QuillJsBundle\Form\QuillType;
use Ehyiah\QuillJsBundle\DTO\Modules\STTModule;

public function buildForm(FormBuilderInterface $builder, array $options)
{
    $builder
        ->add('content', QuillType::class, [
            'quill_options' => [
                //
            ],
            'modules' => [
                new SyntaxModules(),
                new TableModule(
                    'menus' => ['column', 'row', 'merge', 'table', 'cell', 'wrap', 'copy', 'delete'],
                    'toolbarTable' => 'true', // must be set to true to show the table toolbar options in TableModule
                    'language' => 'fr_FR',
                ),
            ],
            //
        ])
    ;
}

Modules list

See module details on the left menu

modulesauto-importeddescriptionnameoptions typeoptionsdefault options
EmojiModuleYESrequired if emoji Field is activatedemoji-toolbarstringNONE'true'
ResizeModuleYESused in ImageField, https://www.npmjs.com/package/quill-resize-imageresizearray[][]
SyntaxModuleYESTo use with CodeBlockField field, see official descriptionsyntaxstringNONE'true'
HistoryModuleNOThe History module is responsible for handling undo and redo for Quill. see details on official sitehistoryarraydelay, maxStack, userOnly['delay' => '1000', 'maxStack' => '100', 'userOnly' => 'false']
SmartLinksModuleNOautomatic recognition of links (can be customized within options)smartLinksarraylinkRegex['linkRegex' => '/https?://[^\s]+/']
CounterModuleNOCount of number and Words inside WYSIWYG (display below WYSIWYG instance by default or inside a custom html Element if you want : specify an ID in *_container with the '#') characters counter display 1 character by default because Quill is instantiated with a

that count as 1 character
counterarraywords, words_label, words_container, characters, characters_label, characters_container['words' => true, 'words_label' => 'Number of words : ', 'words_container' => '', 'characters' => true, 'characters_label' => 'Number of characters : ', 'characters_container' => '']
TableModuleYESThe Table module is responsible for handling table options. see details on repository sitetable-betterarrayhttps://github.com/attoae/quill-table-bettersee Ehyiah\QuillJsBundle\DTO\Modules\TableModule
FullScreenModuleNOAdd a FullScreen button to the toolbar sitetoggleFullscreenarraybuttonTitle, buttonHTML check https://github.com/qvarts/quill-toggle-fullscreen-button?tab=readme-ov-file#apisee Ehyiah\QuillJsBundle\DTO\Modules\FullScreenModule
HtmlEditModuleNOThe HtmlEditModule allow to edit the raw html. see details on repository sitehtmlEditButtonarrayhttps://github.com/benwinding/quill-html-edit-buttonsee Ehyiah\QuillJsBundle\DTO\Modules\htmlEditButton
ReadTimeModuleNOThe ReadTimeModule add an indication on how many minutes it will take to a person to read what your write inside the WYSIWYG editorreadingTimearraywpm, label, suffix, readTimeOk, readTimeMedium, target['wpm' => '200', 'label' => 'Reading time: ', 'suffix' => ' min read', 'readTimeOk' => '2', 'readTimeMedium' => '5']
STTModuleNOThe Speech-to-Text module enables voice dictation using the Web Speech API. Allows users to dictate text directly into the editor with real-time audio visualizationspeechToTextarraylanguage, continuous, visualizer, waveformColor, histogramColor, debug, buttonTitleStart, buttonTitleStop, titleInactive, titleStarting, titleActivesee Ehyiah\QuillJsBundle\DTO\Modules\STTModule