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.
See it composed with the PDF Viewer in the Layout Blocks block.
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 |