umanit / tiptap-bundle
Standalone TipTap rich text editor for Symfony (Twig components, Stimulus controllers, form type).
Requires
- php: ^8.4
- ext-dom: *
- ext-libxml: *
- symfony/form: ^7.4 || ^8.0
- symfony/framework-bundle: ^7.4 || ^8.0
- symfony/stimulus-bundle: ^2.0
- symfony/translation: ^7.4 || ^8.0
- symfony/twig-bundle: ^7.4 || ^8.0
- symfony/ux-icons: ^2.0
- symfony/ux-twig-component: ^2.0
- twig/twig: ^3.0
Requires (Dev)
- doctrine/dbal: ^3.8 || ^4.0
- doctrine/doctrine-bundle: ^2.11 || ^3.0
- doctrine/orm: ^2.14 || ^3.0
- symfony/process: ^7.4 || ^8.0
- umanit/dev-bundle: ^3.2
Suggests
- doctrine/dbal: Lets the audit and the migration read and rewrite the columns of the database which hold contents
- doctrine/orm: Maps the table where the migration saves the contents it rewrites, so that `doctrine:migrations:diff` creates it
- symfony/process: Needed by the `umanit:tiptap:audit` command, which runs the editor under Node
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-23 15:35:17 UTC
README
Standalone TipTap rich text editor for Symfony: Twig components, Stimulus controllers and a form type, plus the tooling to migrate existing contents written with another editor (CKEditor…). No dependency on Bootstrap or on any application framework.
Status: work in progress. Nothing is stable yet and the package is not released: see the changelog.
Requirements
- PHP
^8.4withext-domandext-libxml - Symfony
^7.4 || ^8.0, withsymfony/stimulus-bundle,symfony/ux-twig-componentandsymfony/ux-icons - Webpack Encore or AssetMapper
- Optional:
symfony/process+ Node (audit, clean and palette commands),doctrine/dbalanddoctrine/orm(read and rewrite the columns of the database)
Installation
composer require umanit/tiptap-bundle
The JavaScript package @umanit/tiptap-bundle ships in the assets/ directory of the Composer package. Its four
Stimulus controllers (editor, dropdown, image, modal) are declared in assets/controllers.json, which Symfony
Flex does for you. With Webpack Encore, reference the package from your package.json:
"@umanit/tiptap-bundle": "file:vendor/umanit/tiptap-bundle/assets"
With AssetMapper the bundle exposes its sources by itself, but @tiptap/pm has no root export, so its sub-paths must be
required explicitly. The playground is a working application for both pipelines and lists the
exact steps.
Usage
In a form:
use Umanit\TiptapBundle\Form\Type\TiptapType; $builder->add('body', TiptapType::class, [ 'toolbar' => 'default', 'styles_set' => 'default', 'colors_set' => 'default', ]);
Other options: background_colors_set, cell_background_colors_set, templates_set, file_manager_url,
file_manager_adapter and migration_diff.
Standalone, in Twig:
<twig:Umanit:Tiptap:Editor id="body" name="body" :content="html" />
Customizing the editor
The toolbar, the styles, the colors and the templates are built by services you can replace. Implement one of
ToolbarBuilderInterface, StylesSetsBuilderInterface, ColorsSetBuilderInterface or
TemplatesSetBuilderInterface (src/Builder): it is picked up by autoconfiguration. The default builders are neutral.
Configuration
# config/packages/umanit_tiptap.yaml umanit_tiptap: migration_diff: false # warn when a loaded content is rewritten by the editor (acceptance environments) audit: node_command: node # how to start Node (`yarn node` with Yarn PnP)
Styling
Native CSS, no preprocessor: tiptap-editor.css (the editor UI), tiptap-content.css (the content, to load where it is
displayed) and tiptap-email.css (inlined styles for emails), in assets/dist/css. The PurgeCSS safelist is exposed as
@umanit/tiptap-bundle/purgecss-safelist.
Migrating existing contents
Four console commands take contents written with another editor to TipTap, in this order:
| Command | Purpose | Documentation |
|---|---|---|
umanit:tiptap:audit |
Measure what the schema would drop from the contents | migration-audit.md |
umanit:tiptap:clean |
Remove the leftovers of Word and of other editors | cleaning.md |
umanit:tiptap:palette |
Build the palette of the colors and sizes the contents use | palette.md |
umanit:tiptap:migrate |
Rewrite the contents (with backup and rollback) | migration.md |
All of them simulate by default. Other documents:
- The round-trip CLI: the Node script behind the audit, usable on its own.
- The migration diff: in the editor, warn when a loaded content is rewritten and show the difference.
Development
You need PHP 8.4 (ext-dom, ext-libxml), Composer, and Node and Yarn at the versions of mise.toml
(mise install works, so does any other version manager):
composer install cd assets && yarn install make full_static_analyze
A Nix flake is provided for those who use Nix (direnv allow or nix develop); it is optional.
See AGENTS.md for the conventions of the project.