Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tiptap/extension-color

Package Overview
Dependencies
Maintainers
5
Versions
138
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tiptap/extension-color

text color extension for tiptap

  • 2.10.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
247K
decreased by-14.4%
Maintainers
5
Weekly downloads
 
Created

What is @tiptap/extension-color?

@tiptap/extension-color is an extension for the Tiptap editor that allows users to apply color to text. It provides a straightforward way to add color functionality to your Tiptap editor setup, enabling users to change the text color through a user-friendly interface.

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

Add Color to Text

This feature allows you to add color to text within the Tiptap editor. The code sample demonstrates how to configure the Color extension and apply a red color to the text.

import { Color } from '@tiptap/extension-color';
import { Editor } from '@tiptap/core';

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

editor.chain().focus().setColor('#ff0000').run();

Remove Color from Text

This feature allows you to remove color from text within the Tiptap editor. The code sample demonstrates how to configure the Color extension and remove the color from the text.

import { Color } from '@tiptap/extension-color';
import { Editor } from '@tiptap/core';

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

editor.chain().focus().unsetColor().run();

Other packages similar to @tiptap/extension-color

Keywords

FAQs

Package last updated on 26 Nov 2024

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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc