Skip to content

Basic Usage | Header & Footer

You can configure headers and footers during editor initialization:

import { Editor } from '@tiptap/core'
import StarterKit from '@tiptap/starter-kit'
import { PaginationPlus } from 'tiptap-pagination-plus'
const editor = new Editor({
extensions: [
StarterKit,
PaginationPlus.configure({
// Header configuration
headerLeft: "Document Title",
headerRight: "Page {page}",
// Footer configuration
footerLeft: "Confidential",
footerRight: "Page {page} of {total}",
}),
],
})

The PaginationPlus extension supports four basic configuration options for headers and footers:

  • headerLeft: Content displayed on the left side of the header
  • headerRight: Content displayed on the right side of the header
  • footerLeft: Content displayed on the left side of the footer
  • footerRight: Content displayed on the right side of the footer

Each option accepts:

  • Plain text strings
  • HTML strings with formatting
  • Multiline content using HTML tags
PaginationPlus.configure({
headerLeft: "My Document",
headerRight: "Page {page}",
footerLeft: "Confidential",
footerRight: "Page {page}",
})
tiptapplus.com is not an official Tiptap website and has no business affiliation with Tiptap.