Document Splits
A page-thumbnail grid that groups a PDF's pages into multiple output documents by inserting split points between thumbnails, rendered with pdf.js.
Preview
1 document from – pages
Couldn't load this document
Check that the file exists and is a valid PDF.
Document —
<div class="mx-auto w-full max-w-4xl">
<x-ui.document-splits src="/samples/sample.pdf" />
</div>
Installation
php artisan ui:add pro/document-splits
Note
This component ships an Alpine behavior module at
resources/js/ui/document-splits.js. Import it once from your bundle so it registers on alpine:init:
import './document-splits.js';
Use with AI
A brief for your coding agent: install command, usage, props, guidance and the rules. Copy it, or open a prompt about this component in an assistant.
# Brok UI: Document Splits (`document-splits`)
A page-thumbnail grid that groups a PDF's pages into multiple output documents by inserting split points between thumbnails, rendered with pdf.js.
Brok UI is a Laravel Blade component registry. Installed components are plain Blade files the app owns.
## Install
```bash
php artisan ui:add pro/document-splits
```
## Usage
```blade
<div class="mx-auto w-full max-w-4xl">
<x-ui.document-splits src="/samples/sample.pdf" />
</div>
```
## Use when
- Use when users need to upload, inspect, edit, annotate, or sign real documents as part of the workflow.
- Letting a user split one multi-page PDF into several output documents by choosing where each break falls.
- Needing a page-thumbnail grid with toggleable split points instead of a text-only page range input.
## Avoid when
- Do not use a heavy document interface when the same task can be completed more simply in structured product UI.
- The PDF should just be viewed or paged through, not split; use pdf-viewer instead.
- The workflow only ever needs a fixed, predetermined page range with no interactive choice.
## Anti-patterns
- Heavy document UI when structured fields are simpler
## Rules
- Use the `<brok:document-splits>` tag (or `<x-ui.document-splits>`) in Blade; do not rewrite the component.
- Prefer the documented props and variants over utility-class overrides; when a utility must win, use the `!` important modifier.
- Use semantic design tokens (`bg-primary`, `text-muted-foreground`), never raw colour utilities.
- Keep the `data-slot` attributes; they are the styling and test hooks.
## Links
- Docs: https://brokui.dev/docs/components/document-splits
Working in Claude Code, Cursor or Codex? Give the agent the whole registry through the MCP server or the Brok UI skill.
API
Props
No documented props. Pass normal Blade attributes through the component root.
Slots
default—
Data slots
Stable hooks for CSS overrides and browser tests.
No data-slot selectors found in the registry source.
Behavior
- Renders a canvas thumbnail for every page of the source PDF and groups consecutive pages into output documents based on the current split points.
- Clicking the toggle in the gap after a page adds or removes a split point there, re-grouping pages into documents live.
- The reset action clears every split point back to a single document, and is disabled while loading or when there are no splits to reset.
- Installs a JavaScript behavior module when the registry item includes resources/js/ui files.
Guidance
Upload, inspect, edit, annotate, or sign a real document.
Use when
- Use when users need to upload, inspect, edit, annotate, or sign real documents as part of the workflow.
- Letting a user split one multi-page PDF into several output documents by choosing where each break falls.
- Needing a page-thumbnail grid with toggleable split points instead of a text-only page range input.
Avoid when
- Do not use a heavy document interface when the same task can be completed more simply in structured product UI.
- The PDF should just be viewed or paged through, not split; use pdf-viewer instead.
- The workflow only ever needs a fixed, predetermined page range with no interactive choice.
Use instead
- Structured product form
- Direct data entry
Anti-patterns
- Heavy document UI when structured fields are simpler
- Anatomy
Accessibility
- Keyboard
- No component-owned keyboard interaction; native element behavior applies.
- Focus
none
- Each split toggle is a real button with aria-pressed and an aria-label naming the page it splits after, so its state is announced rather than conveyed by icon and colour alone.
- Each page thumbnail and each document group carries its own accessible label (page number, or document number and page range).
- Semantic HTML and a stable
data-slotattribute for styling and scripting hooks. - Focus-visible rings use the
ringtoken, so keyboard focus is always visible. - Disabled and invalid states are conveyed to assistive tech, not by color alone.
- Targets WCAG 2.2 AA; verify contrast in light, dark, admin and customer surfaces in the preview.
- Labels go through
__()and layout uses logical properties (ms-*,text-start), so it mirrors underdir="rtl"— flip the preview to RTL to confirm. - Dark mode uses the same semantic tokens under the
darkclass; high contrast follows forced-color system tokens.
Livewire
Livewire can update this component through forwarded wire:* attributes.
Source
Source available with Pro
This preview shows the real Pro component, while its installable source is delivered only through the authenticated registry. Activate a license, then use the installation command above.
Open the authenticated source endpoint
Ownership & lifecycle
Owner, release state, review evidence and adoption for this item.
- Owner
- Platform UI (@JoshJML)
- Current version
-
1.2.0 - Status
- Stable
- License
-
pro - Accessibility reviewed
- No review date recorded
- Last breaking change
- No date recorded
- Deprecation
- Not deprecated