2

Document Splits

Organize long PDFs into smaller documents with lazy page thumbnails and drag-and-drop grouping.

Document Splits provide editable split groups for long documents. Pair them with the PDF Viewer block when users need to preview pages while organizing output documents.

See it composed with the PDF Viewer in the Document Splits block.

"use client";

import * as React from "react";

import {
  DocumentSplits,
  type DocumentSplit,
  type DocumentSplitPageId,
} from "@/components/ui/document-splits";

Installation

pnpm dlx shadcn@latest add https://ui.extend.ai/r/document-splits.json

Useful behaviors

  • Lazy PDF page thumbnails rendered from the source document.
  • Drag pages between split groups and reorder split groups.
  • Vertically scrollable split groups with horizontally scrolling page rows.
  • Pair with the PDF Viewer block when selected pages should scroll the document canvas.

API Reference

DocumentSplits

The DocumentSplits component renders controlled split groups and paints cached page images through FileThumbnail.

PropTypeDefaultRequired
activePagenumber-Yes
classNamestring-No
splitsDocumentSplit[]-Yes
thumbnailImagesRecord<DocumentSplitPageId, string>{}No
withFrameDividerbooleantrueNo
onSelectPage(pageNumber: number) => void-Yes
onSplitsChange(splits: DocumentSplit[]) => void-Yes

DocumentSplit

PropTypeDefaultRequired
idstring-Yes
titlestring-Yes
pagesDocumentSplitPageId[]-Yes