
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
tiptap-community-pages
Advanced tools
Community Tiptap Pagination Extension for legal document editing
A community-built pagination extension for Tiptap that provides WYSIWYG page layout similar to word processors, with support for legal document formats.
@tiptap/core, @tiptap/pm, @tiptap/react)Ctrl+Enter / Cmd+Enternpm i tiptap-community-pages
Import once in your app (e.g. your Next.js layout.tsx, or app entry). This provides the default PageWrapper layout (including mobile fit-to-width scaling) and the hard page break marker styles:
import 'tiptap-community-pages/styles.css'
npm install
npm run dev
Open http://localhost:3000 to see the demo.
npm run lint
npm run type-check
npm test
npm run build
import { useEditor } from '@tiptap/react'
import { EditorContent } from '@tiptap/react'
import StarterKit from '@tiptap/starter-kit'
import { PageBreak, Pagination } from 'tiptap-community-pages'
import { PageWrapper } from 'tiptap-community-pages/react'
const editor = useEditor({
extensions: [
StarterKit,
PageBreak,
Pagination.configure({
pageFormat: 'Letter', // 'A4', 'Letter', or 'Legal'
orientation: 'portrait', // 'portrait' or 'landscape'
margins: {
top: 96, // 1 inch in pixels
right: 96,
bottom: 96,
left: 96,
},
onPageCountChange: (count) => console.log(`${count} pages`),
}),
],
content: '<p>Your content here...</p>',
})
// Wrap your editor
<PageWrapper format="Letter" orientation="portrait">
<EditorContent editor={editor} />
</PageWrapper>
// Change page format dynamically
editor.commands.setPageFormat('Legal')
// Change orientation
editor.commands.setOrientation('landscape')
// Insert a hard page break
editor.commands.setPageBreak()
// Navigate to a specific page
editor.commands.goToPage(2)
Hard page breaks are rendered as a block element with a stable marker for exports/imports:
data-page-break="true".page-break class (always included)| Format | Width | Height | Common Use |
|---|---|---|---|
| US Letter | 816px | 1056px | Standard US documents |
| US Legal | 816px | 1344px | Legal contracts, court documents |
| A4 | 794px | 1123px | International standard |
All dimensions at 96 DPI (standard screen resolution)
This extension uses the "Continuous Flow" model:
This approach ensures:
src/
├── extensions/
│ ├── page-format.ts # Page dimension utilities
│ ├── page-break.ts # Hard page break node
│ ├── pagination.ts # Main pagination extension
│ └── index.ts # Extension exports
├── components/
│ ├── PageWrapper.tsx # Page styling wrapper
│ ├── PagedEditor.tsx # Complete editor component
│ ├── Toolbar.tsx # Format/orientation controls
│ └── index.ts # Component exports
└── app/
├── page.tsx # Demo page
├── layout.tsx # App layout
└── globals.css # Global styles + print CSS
The extension includes comprehensive print CSS that:
@media print {
.page-break {
page-break-after: always;
break-after: page;
}
}
| Shortcut | Action |
|---|---|
Ctrl+Enter / Cmd+Enter | Insert page break |
MIT License - see LICENSE file for details.
FAQs
Community Tiptap Pagination Extension for legal document editing
We found that tiptap-community-pages demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.