🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

tiptap-fontsize-extension

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tiptap-fontsize-extension

A Tiptap extension for adjusting font size in text editors.

1.2.1
latest
Source
npm
Version published
Weekly downloads
251
5.02%
Maintainers
1
Weekly downloads
 
Created
Source

Tiptap Font-Size Extension

A Tiptap extension for adjusting font size in text editors.

Installation

You can install the extension via npm:

npm i tiptap-fontsize-extension

Usage

import { Editor } from '@tiptap/core';
import FontSize from 'tiptap-fontsize-extension';

const editor = new Editor({
  extensions: [
    FontSize.configure({
      defaultSize: '16px',
      step: 1
    }),
    // other extensions
  ],
});

Commands

  • setFontSize(size): Sets the font size to the specified value.
  • getFontSize(): Get the selected font size.
  • increaseFontSize(): Increases the font size by 1px.
  • decreaseFontSize(): Decreases the font size by 1px.
// Get the selected font size
const fontSize = editor.commands.getFontSize();
console.log('Selected font size:', fontSize);

// Set font size to 20px
editor.commands.setFontSize('20px');

// Increase font size by 1px
editor.commands.increaseFontSize();

// Decrease font size by 1px
editor.commands.decreaseFontSize();

PRs are welcome 😃❤️

Keywords

tiptap

FAQs

Package last updated on 06 Apr 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