What is @ckeditor/ckeditor5-heading?
@ckeditor/ckeditor5-heading is a plugin for CKEditor 5 that provides heading functionality. It allows users to format text as headings of various levels, which is essential for structuring content in a meaningful way.
What are @ckeditor/ckeditor5-heading's main functionalities?
Basic Heading
This code initializes a CKEditor instance with the Heading plugin enabled. The toolbar includes a heading button that allows users to apply different heading levels to their text.
ClassicEditor.create(document.querySelector('#editor'), { plugins: [ Heading ], toolbar: [ 'heading' ] })
Custom Heading Options
This code initializes a CKEditor instance with custom heading options. Users can choose from Paragraph, Heading 1, and Heading 2, each with its own styling.
ClassicEditor.create(document.querySelector('#editor'), { plugins: [ Heading ], toolbar: [ 'heading' ], heading: { options: [ { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' }, { model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' }, { model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' } ] } })
Advanced Heading Configuration
This code demonstrates an advanced configuration where additional heading levels (e.g., Heading 3) are added to the editor. This allows for more granular content structuring.
ClassicEditor.create(document.querySelector('#editor'), { plugins: [ Heading ], toolbar: [ 'heading' ], heading: { options: [ { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' }, { model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' }, { model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' }, { model: 'heading3', view: 'h3', title: 'Heading 3', class: 'ck-heading_heading3' } ] } })
Other packages similar to @ckeditor/ckeditor5-heading
quill
Quill is a modern WYSIWYG editor built for compatibility and extensibility. It provides similar heading functionalities through its built-in formats and can be customized with modules. Compared to @ckeditor/ckeditor5-heading, Quill offers a more lightweight and flexible approach but may require more configuration for advanced use cases.
tinymce
TinyMCE is a popular rich text editor that offers comprehensive heading options out of the box. It is highly customizable and supports a wide range of plugins. Compared to @ckeditor/ckeditor5-heading, TinyMCE provides a more extensive set of features but can be more complex to integrate and configure.
draft-js
Draft.js is a JavaScript rich text editor framework maintained by Facebook. It allows for extensive customization and control over content editing, including heading functionalities. Unlike @ckeditor/ckeditor5-heading, Draft.js is more of a framework than a ready-to-use editor, requiring more development effort to achieve similar results.
42.0.0 (June 26, 2024)
We are happy to announce the release of CKEditor 5 v42.0.0
Release highlights
New installation methods
We are excited to announce the latest release of CKEditor 5, bringing major improvements to simplify the installation and setup process. After extensive research and gathering feedback, we have improved the setup methods to enhance the developer experience and align with modern standards.
The most prominent changes:
- All plugins and core features are now available from the unified
ckeditor5
and ckeditor5-premium-features
packages, reducing dependency management complexity. - Our packages became bundler-agnostic. You can use whatever bundler you want (such as Vite or esbuild), to integrate CKEditor 5.
- CSS files are now distributed separately from JavaScript, allowing for parallel downloading, easier customization, and improved performance.
- All the new distribution methods (available via npm, CDN, and ZIP downloads) allow dynamic plugin registration making it easy to add or remove plugins dynamically.
The old installation methods are still supported, but we put them on the deprecation path. Read more about this in our migration guides.
New Builder
Along with the new release, we present you the brand new CKEditor 5 Builder.
The new Builder allows you to start with one of the predefined presets, customize it by adding and removing features, and observe the changes live in an editor preview (and play with the editor!). Once you are happy with your custom setup, you get ready-to-use code snippets for React, Angular, Vue, and VanillaJS setups for both npm and CDN distributions.
Updated documentation
We rewrote large parts of the documentation to complete the picture and ensure consistency across the ecosystem. The entire Getting started section was redesigned to focus on the new installation methods and to better guide the integrator through the ecosystem.
If you need clarification or a more in-depth explanation, please let us know.
Migration paths
Finally, detailed migration guides can be found in our documentation. These guides provide step-by-step instructions and examples to help you seamlessly transition to the new installation methods:
We value your input, so please share your experiences, ask questions, and provide feedback to help us refine these changes. Join us in this exciting new chapter for CKEditor 5 and let’s make the developer experience as smooth and enjoyable as possible.
Removal of superbuild and predefined builds from the CDN
We have stopped publishing the superbuild and predefined builds to our CDN. Predefined builds can still be accessed as an npm package. If you want to keep using our CDN with new versions of the editor, we recommend migrating to the new installation methods.
Other updates
We are excited to announce a major update to our premium Export to Word feature, delivering significantly improved quality with multiple enhancements and bug fixes. This release also brings a substantial reduction in the conversion time. Export to Word v2 is an opt-in feature right now, and to use it you need to slightly change the editor’s configuration. Detailed information can be found in the documentation.