318

Layout Blocks

Inspect layout text blocks, lines, words, and confidence overlays on top of PDF pages.

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.

PropTypeDefaultRequired
activeBlockIdstring-No
blocksOcrBlock[]-Yes
classNamestring-No
onBlockFocus(block: OcrBlock) => void-No