npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-ckeditor5-custom

v1.0.6

Published

A custom editor build of CKEditor5, based on the predefined classic editor build, for React implementation

Downloads

78

Readme

CKEditor5 - Custom CKEditor5 build for React

Description

This is a custom build editor, based on the Classic editor build from CKEditor5. It contains a list of available plugins, that can be easily customized and used in your React project.

Available plugins

Here is a list of the currently available plugins in this editor from which you can choose and use, based on your needs:

  • Autoformat
  • BasicStyles
  • BlockQuote
  • CloudServices
  • CodeBlock
  • EditorClassic
  • Essentials
  • Font
  • Heading
  • Image
  • Indent
  • Link
  • List
  • MediaEmbed
  • Paragraph
  • PasteFromOffice
  • SourceEditing
  • Table
  • Typing
  • Undo

Installation

In order to use CKEditor5, we need to install two packages. Open a terminal in your project and run the following commands to install both of them:

  1. Official CKEditor 5 rich text editor component for React npm i @ckeditor/ckeditor5-react

  2. This custom build of the CKEditor5 for React npm i react-ckeditor5-custom

Usage

Once we have both of the needed packages installed, we can start implementing the editor into our project.

This is one simple example of how the editor could be used in our project. It will show only the specified features in the editor's toolbar, in the same order and grouped based on the '|' symbol.

import React from 'react'
import { CKEditor } from  '@ckeditor/ckeditor5-react'
import  Editor  from  'react-ckeditor5-custom'

const MyApp = () => {
	return (
		<>
			<CKEditor
				editor={Editor}
				config={{
					toolbar: [
						'undo', 'redo', '|', 
						'fontSize', 'fontColor', 'fontBackgroundColor', '|', 
						'bold', 'italic', 'underline'
					]
				}}
				data={'This is my content'}
				onChange={(event) => {
					console.log(event)
				}}
			/>
		</>
	)
}
export default MyApp

If we want our editor to include all of the available features, then we just use the editor without specifically configuring the toolbar. Simply leave it out. Please note, that this will add all of the features, in a predefined order by the editor.

...
    <CKEditor
	    editor={Editor}
	    data={'This is my content'}
	    onChange={(event) => {
		    console.log(event)
	    }}
    />
...

In the case that we want to use most of the available features, except for a few, we can simply remove them.

...
	<CKEditor
		editor={Editor}
		config={{
			toolbar: {
				removeItems: ['bold', 'fontColor', 'imageUpload']
			}
		}}
		data={'This is my content'}
		onChange={(event) => {
			console.log(event)
		}}
	/>
...

For more ways to customize your editor, please visit the official CKEditor5 documentation.

Component properties

To see the details about all of the component's properties, please visit this link from the official CKEditor5 documentation. Go through all of them and read them carefully, so you can further customize the editor based on your requirements.

Editing the toolbar

In order to add / remove features from the toolbar, we can specify which features we want to include by adding them to the toolbar list in the configuration. If we want to show all available features, we can leave out the toolbar list. Check out the official documentation for more features.

Here is the list of all currently available features that can be used:

toolbar: [
    'undo', 'redo', 'fontFamily', 'fontSize', 'fontColor', 'fontBackgroundColor', 'bold', 'italic', 'underline', 'strikethrough', 'link', 'imageUpload', 'insertTable', 'blockQuote', 'bulletedList', 'numberedList', 'outdent', 'indent', 'mediaEmbed', 'codeBlock', 'subscript', 'superscript', 'strikethrough', 'code', 'sourceEditing'
]

Adding or removing plugins

TODO

Rebuilding editor

TODO

License

Licensed under the terms of the MIT License. For full details about the license, please check the LICENSE.md file or visit CKEditor5's page.

Screenshots

Editor1 Editor2 Editor3 Editor4