Skip to content

Latest commit

 

History

History
86 lines (66 loc) · 2.47 KB

text-style-kit.mdx

File metadata and controls

86 lines (66 loc) · 2.47 KB
title tags meta extension
TextStyleKit extension
title description category
TextStyleKit extension | Tiptap Editor Docs
All necessary text style extensions in one extension with TextStyleKit. Perfect for quickly registering the most common text styles with Tiptap. More in the docs!
Editor
name link description type icon
TextStyleKit
All common text styles in one. It doesn’t get much better than this.
extension
Package

import { CodeDemo } from '@/components/CodeDemo'

The TextStyleKit is a collection of the most common Tiptap text style extensions. If you quickly want to setup styles for your text in Tiptap, this extension is for you.

Install

npm install @tiptap/extension-text-style

Included extensions

Marks

Functionality

Source code

packages/extension-text-style/

Using the TextStyleKit extension

Pass TextStyleKit to the editor to load all included extension at once.

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

const editor = new Editor({
  extensions: [TextStyleKit],
})

You can configure the included extensions, or even disable a few of them, like shown below.

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

const editor = new Editor({
  extensions: [
    TextStyleKit.configure({
      // Disable an extension
      backgroundColor: false,

      // Configure an extension
      fontSize: {
        types: ['heading', 'paragraph'],
      },
    }),
  ],
})