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

@tiptap/extension-blockquote

Package Overview
Dependencies
Maintainers
5
Versions
169
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tiptap/extension-blockquote

blockquote extension for tiptap

  • 2.9.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
993K
increased by5.23%
Maintainers
5
Weekly downloads
 
Created

What is @tiptap/extension-blockquote?

@tiptap/extension-blockquote is an extension for the Tiptap editor that allows users to easily add and manage blockquotes within their rich text content. It provides a simple way to include blockquote formatting, making it easier to highlight quotes or important text in a visually distinct manner.

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

Adding a Blockquote

This code demonstrates how to add the Blockquote extension to a Tiptap editor instance and toggle a blockquote in the editor content.

import { Blockquote } from '@tiptap/extension-blockquote';
import { Editor } from '@tiptap/core';

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

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

Customizing Blockquote Styling

This code shows how to extend the Blockquote extension to add custom styling attributes and apply custom CSS to the blockquote element.

import { Blockquote } from '@tiptap/extension-blockquote';
import { Editor } from '@tiptap/core';
import { css } from 'styled-components';

const CustomBlockquote = Blockquote.extend({
  addAttributes() {
    return {
      class: {
        default: 'custom-blockquote',
      },
    };
  },
});

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

const styles = css`
  .custom-blockquote {
    border-left: 4px solid #ccc;
    padding-left: 16px;
    color: #666;
  }
`;

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

Other packages similar to @tiptap/extension-blockquote

Keywords

FAQs

Package last updated on 23 Oct 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