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 🙏

© 2026 – Pkg Stats / Ryan Hefner

grapesjs-rte-toolbar-extensions

v1.0.8

Published

Grapesjs RTE Toolbar Extensions

Readme

Grapesjs RTE Toolbar Extensions

DEMO

HTML

<link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet">
<script src="https://unpkg.com/grapesjs"></script>
<script src="https://unpkg.com/grapesjs-rte-toolbar-extensions"></script>

<div id="gjs"></div>

JS

const editor = grapesjs.init({
	container: '#gjs',
  height: '100%',
  fromElement: true,
  storageManager: false,
  plugins: ['grapesjs-rte-toolbar-extensions'],
});

CSS

body, html {
  margin: 0;
  height: 100%;
}

Summary

  • Plugin name: grapesjs-rte-toolbar-extensions
  • Description: This plugin extends the default GrapesJS Rich Text Editor (RTE) toolbar by adding a wide range of customizable text formatting tools. It includes buttons for inline styles (bold, italic, underline, strikethrough), font families and sizes, headings, alignment, quotes, lists, indentation, subscript/superscript, case transformation, horizontal line, undo/redo, and even a custom “span” wrapper with its own GrapesJS toolbar support. Each feature is modular and can be enabled or disabled individually through options.

Options

Options

| Option | Description | Default | |-------------------------|-----------------------------------------------------------------------------------------------|-------------| | base.bold | Enables the bold button. | true | | base.italic | Enables the italic button. | true | | base.underline | Enables the underline button. | true | | base.strikethrough | Enables the strikethrough button. | true | | base.link | Enables the link button. | true | | fonts.span | Adds a wrap in span button. | true | | fonts.fontName | Array of font names to be displayed in a dropdown. Set to false to disable. | false | | fonts.fontSize | Enables a font size dropdown selector. | false | | format.heading1 | Adds H1 format button. | true | | format.heading2 | Adds H2 format button. | true | | format.heading3 | Adds H3 format button. | true | | format.heading4 | Adds H4 format button. | true | | format.heading5 | Adds H5 format button. | true | | format.heading6 | Adds H6 format button. | true | | format.paragraph | Adds Paragraph format button. | true | | format.quote | Adds a blockquote format button. | true | | subscriptSuperscript | Adds subscript and superscript buttons. | true | | indentOutdent | Adds indent and outdent buttons. | true | | list | Adds ordered list and unordered list buttons. | true | | align | Adds text alignment buttons: left, center, right, justify. | true | | actions | Reserved for future use (currently unused). | true | | undoredo | Adds undo and redo buttons. | true | | extra | Adds uppercase, lowercase, and horizontal line tools. | true | | icons | Object allowing to override default button icons. Example: { heading1: '<b>H1</b>' }. | {} | | maxWidth | Optional CSS max-width for the toolbar element. Example: "700px" | undefined |

Download

  • CDN
    • https://unpkg.com/grapesjs-rte-toolbar-extensions
  • NPM
    • npm i grapesjs-rte-toolbar-extensions
  • GIT
    • git clone https://github.com/steeven-th/grapesjs-rte-toolbar-extensions.git

Usage

Directly in the browser

<link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet"/>
<script src="https://unpkg.com/grapesjs"></script>
<script src="path/to/grapesjs-rte-toolbar-extensions.min.js"></script>

<div id="gjs"></div>

<script type="text/javascript">
  var editor = grapesjs.init({
      container: '#gjs',
      // ...
      plugins: ['grapesjs-rte-toolbar-extensions'],
      pluginsOpts: {
        'grapesjs-rte-toolbar-extensions': { /* options */ }
      }
  });
</script>

Modern javascript

import grapesjs from 'grapesjs';
import rteToolbarExtensionsPlugin from 'grapesjs-rte-toolbar-extensions';
import 'grapesjs/dist/css/grapes.min.css';

const editor = grapesjs.init({
  container : '#gjs',
  // ...
  plugins: [rteToolbarExtensionsPlugin],
  pluginsOpts: {
    [rteToolbarExtensionsPlugin]: { /* options */ }
  }
  // or
  plugins: [
    editor => rteToolbarExtensionsPlugin(editor, { /* options */ }),
  ],
});

Example

import grapesjs from 'grapesjs';
import rteToolbarExtensionsPlugin from 'grapesjs-rte-toolbar-extensions';
import 'grapesjs/dist/css/grapes.min.css';

const editor = grapesjs.init({
    container : '#gjs',
    height: '100%',
    fromElement: true,
    storageManager: false,
    plugins: [rteToolbarExtensionsPlugin],
    pluginsOpts: {
        [rteToolbarExtensionsPlugin]: {
            base: {
                bold: true,
                italic: true,
                underline: true,
                strikethrough: false,
                link: true,
            },
            fonts: {
                span: true,
                fontName: ['Arial', 'Georgia', 'Courier New'],
                fontSize: true,
            },
            format: {
                heading1: true,
                heading2: true,
                heading3: false,
                heading4: false,
                heading5: false,
                heading6: false,
                paragraph: true,
                quote: true,
            },
            subscriptSuperscript: true,
            indentOutdent: true,
            list: true,
            align: true,
            actions: true,
            undoredo: true,
            extra: true,
            icons: {
                heading1: '<b>H1</b>',
                heading2: '<b>H2</b>',
                uppercase: '<span style="font-weight:bold;">UP</span>',
            },
            maxWidth: '700px',
        },
    }
});

Development

Clone the repository

$ git clone https://github.com/steeven-th/grapesjs-rte-toolbar-extensions.git
$ cd grapesjs-rte-toolbar-extensions

Install dependencies

$ npm i

Start the dev server

$ npm start

Build the source

$ npm run build

License

MIT