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

@tiptap/extension-heading

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-heading

heading extension for tiptap

  • 2.10.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.1M
increased by10.22%
Maintainers
5
Weekly downloads
 
Created

What is @tiptap/extension-heading?

@tiptap/extension-heading is an extension for the Tiptap text editor that allows you to add and manage heading elements in your rich text content. It provides a straightforward way to include headings of various levels (e.g., H1, H2, H3) in your editor, making it easier to structure and format your text.

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

Add Heading

This feature allows you to add heading elements to your Tiptap editor. You can configure which heading levels are available (e.g., H1, H2, H3).

const editor = new Editor({
  extensions: [
    Heading.configure({
      levels: [1, 2, 3],
    }),
  ],
})

Set Heading Level

This feature allows you to set the heading level for a selected text. In this example, the selected text is set to a level 2 heading (H2).

editor.chain().focus().toggleHeading({ level: 2 }).run()

Check Heading Level

This feature allows you to check if the current selection is a heading of a specific level. In this example, it checks if the selection is an H1 heading.

const isHeading = editor.isActive('heading', { level: 1 })

Other packages similar to @tiptap/extension-heading

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