Layout Blocks help users debug and review the text layer behind scanned or image-heavy PDFs. They should show document structure without replacing the original page image.
The PDF Layout Blocks and DOCX Layout Blocks previews share the same panel, cards, and type badges.
Installation
pnpm dlx shadcn@latest add @extend/layout-blocks
Useful behaviors
- Toggleable block, line, and word overlays.
- Confidence coloring for low-quality layout regions.
- Hover and selection states that reveal text and geometry.
- Region navigation from layout results to the rendered PDF page.
API Reference
OcrBlocksPanel
The OcrBlocksPanel component renders selectable layout results with type, markdown text, confidence, and page context.
| Prop | Type | Default | Required |
|---|---|---|---|
activeBlockId | string | - | No |
blocks | OcrBlock[] | - | Yes |
className | string | - | No |
onBlockFocus | (block: OcrBlock) => void | - | No |