Socket
Socket
Sign inDemoInstall

@tiptap/extension-text-style

Package Overview
Dependencies
Maintainers
4
Versions
152
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tiptap/extension-text-style

text style extension for tiptap


Version published
Weekly downloads
277K
decreased by-4.58%
Maintainers
4
Weekly downloads
 
Install size
Created

Package description

What is @tiptap/extension-text-style?

@tiptap/extension-text-style is an extension for the Tiptap editor that allows you to apply various text styles to your content. It provides a flexible way to add custom styles to text, such as color, background color, font size, and more.

What are @tiptap/extension-text-style's main functionalities?

Apply Text Color

This feature allows you to apply a specific color to the text. The code sample demonstrates how to configure the TextStyle extension and apply a red color to the text.

import { TextStyle } from '@tiptap/extension-text-style';
import { Editor } from '@tiptap/core';

const editor = new Editor({
  extensions: [
    TextStyle.configure({ types: ['textStyle'] }),
  ],
  content: '<p>Hello World!</p>',
});

// Apply text color
editor.chain().focus().setTextStyle({ color: '#ff0000' }).run();

Apply Background Color

This feature allows you to apply a background color to the text. The code sample demonstrates how to configure the TextStyle extension and apply a green background color to the text.

import { TextStyle } from '@tiptap/extension-text-style';
import { Editor } from '@tiptap/core';

const editor = new Editor({
  extensions: [
    TextStyle.configure({ types: ['textStyle'] }),
  ],
  content: '<p>Hello World!</p>',
});

// Apply background color
editor.chain().focus().setTextStyle({ backgroundColor: '#00ff00' }).run();

Apply Font Size

This feature allows you to apply a specific font size to the text. The code sample demonstrates how to configure the TextStyle extension and apply a font size of 24px to the text.

import { TextStyle } from '@tiptap/extension-text-style';
import { Editor } from '@tiptap/core';

const editor = new Editor({
  extensions: [
    TextStyle.configure({ types: ['textStyle'] }),
  ],
  content: '<p>Hello World!</p>',
});

// Apply font size
editor.chain().focus().setTextStyle({ fontSize: '24px' }).run();

Other packages similar to @tiptap/extension-text-style

Changelog

Source

2.1.13 (2023-11-30)

Bug Fixes

  • react: fix performance regression because of select/deselect (#4661) (ad7f659)

Readme

Source

@tiptap/extension-text-style

Version Downloads License Sponsor

Introduction

Tiptap is a headless wrapper around ProseMirror – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as New York Times, The Guardian or Atlassian.

Official Documentation

Documentation can be found on the Tiptap website.

License

Tiptap is open sourced software licensed under the MIT license.

Keywords

FAQs

Package last updated on 30 Nov 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc