New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@skchawala/editorjs-text-style

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@skchawala/editorjs-text-style

An Editor.js inline tool for applying font size and font family styles to selected text.

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

EditorJS Text Style Tool

✍️ An EditorJS inline tool for customizing font size and font family — lightweight, configurable, and easy to use.

Demo

EditorJS Text Style Demo

Features

  • 🎨 Change font size inline
  • 🅰️ Switch font family
  • ⚡ Plug & Play with EditorJS
  • 🔧 Fully configurable (define your own sizes and families)
  • 🪶 Lightweight, no extra dependencies

Installation

Install via npm or yarn:

npm install @skchawala/editorjs-text-style

or

yarn add @skchawala/editorjs-text-style

🚀 Usage

import EditorJS from "@editorjs/editorjs";
import TextStyleTool from "@skchawala/editorjs-text-style";

const editor = new EditorJS({
  holder: "editorjs",
  autofocus: true,
  tools: {
    textStyle: {
      class: TextStyleTool,
      config: {
        fontSizeEnabled: true,
        fontFamilyEnabled: true,
        fontSizes: [
          { label: "12px", value: "12px" },
          { label: "14px", value: "14px" },
          { label: "16px", value: "16px" },
          { label: "18px", value: "18px" },
          { label: "20px", value: "20px" },
        ],
        fontFamilies: [
          { label: "Arial", value: "Arial" },
          { label: "Georgia", value: "Georgia" },
          { label: "Courier New", value: "Courier New" },
          { label: "Verdana", value: "Verdana" },
        ],
        defaultFontSize: "20px",
        defaultFontFamily: "Verdana",
      },
    },
  },
});

⚙️ Configuration Options

OptionTypeDefaultDescription
fontSizeEnabledbooleantrueEnable or disable font size dropdown
fontFamilyEnabledbooleantrueEnable or disable font family dropdown
fontSizesFontSizeOption[]Predefined setCustom array of font size options { label, value }
fontFamiliesFontFamilyOption[]Predefined setCustom array of font family options { label, value }
defaultFontSizestring"16px"Default font size applied when no selection is made
defaultFontFamilystring"Inter, sans-serif"Default font family applied

🛠️ Output Data

<p>
  This is <span class="cdx-text-style" style="font-size: 20px; font-family: Verdana;">styled text</span> inside Editor.js.
</p>

📜 Changelog

You can find the full list of changes in the CHANGELOG.md.

Keywords

editorjs

FAQs

Package last updated on 13 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts