# with-pages-slate

> A package that helps you build pagination for Slate React

Latest version **1.0.5** (published 2023-12-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install with-pages-slate
pnpm add with-pages-slate
yarn add with-pages-slate
bun add with-pages-slate
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2023-12-26 |
| First published | 2023-12-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 13.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | andrew3314 |
| Maintainers | andrew3314 |
| Keywords | slate, slate-react, slatejs, pagination, paged, pages, document |

## Links

- npm: https://www.npmjs.com/package/with-pages-slate
- Repository: https://github.com/andrew3314/slate-with-pages
- Homepage: https://github.com/andrew3314/slate-with-pages#readme
- Issues: https://github.com/andrew3314/slate-with-pages/issues
- npm.io page: https://npm.io/package/with-pages-slate

## Dependencies (5)

- [react](https://npm.io/package/react.md) ^18.2.0
- [slate](https://npm.io/package/slate.md) ^0.101.5
- [typescript](https://npm.io/package/typescript.md) ^5.3.3
- [slate-react](https://npm.io/package/slate-react.md) ^0.101.5
- [slate-history](https://npm.io/package/slate-history.md) ^0.100.0

## Alternatives

- [@cantoo/pdf-lib](https://npm.io/package/@cantoo/pdf-lib.md) — 297.9K weekly downloads
- [datatables.net-buttons](https://npm.io/package/datatables.net-buttons.md) — 200.1K weekly downloads
- [@ckeditor/ckeditor5-export-pdf](https://npm.io/package/@ckeditor/ckeditor5-export-pdf.md) — 167.0K weekly downloads
- [scanbot-web-sdk](https://npm.io/package/scanbot-web-sdk.md) — 15.0K weekly downloads
- [@syncfusion/ej2-angular-pdfviewer](https://npm.io/package/@syncfusion/ej2-angular-pdfviewer.md) — 8.8K weekly downloads

## Recent versions

- 1.0.5 (latest) — 2023-12-26
- 1.0.4 — 2023-12-26
- 1.0.3 — 2023-12-26
- 1.0.2 — 2023-12-26
- 1.0.1 — 2023-12-26
- 1.0.0 — 2023-12-26

## README

## Logic
In essence, it is a normalizer that checks whether or not there is oveflow on the 'page' node. Case positive, it then checks if there already is a next page, then it splits the selection and wraps it around another node or just move the selection according to the former condition. 

## Usage
To use this package, install it through `npm i with-pages-slate`. Then, import it and extend the editor as follows:

```
// ... other imports
import { withPages } from 'with-pages-slate'

// then use it as a normal plugin
const editor = withPages(createEditor(), {
    pageTypeName: 'node type', //custom node type that will represent your page node
    emptyPage: Element //see [1] below
})
```

\[1] an element to be rendered as your blank page everytime a page break occurs. Be aware that you need to declare your custom node type. Check the demo editor and Slate documentation on the subject for better comprehension

---
_Source: https://npm.io/package/with-pages-slate · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
