BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/retab-ui/pdf-viewer

PDF Viewer

retab-ui/pdf-viewer
FreeComponent

A pdfjs-backed PDF viewer: continuous scroll, controlled or uncontrolled zoom, rotate, fit-to-width, download, a per-page overlay slot for bounding-box citations, a PdfHighlight overlay, and imperative scrollToPage / scrollToPageArea handles for driving source highlights.

Install it

npx shadcn@latest add https://ui.retab.com/r/pdf-viewer.json

Source

registry/new-york-v4/ui/pdf-viewer.tsxui.retab.com/r/pdf-viewer.json
1"use client";
2
3import * as React from "react";
4
5import { cn } from "@/lib/utils";
6
7import {
8 FileViewer,
9 FileViewerContent,
10 FileViewerHeader,
11 FileViewerControls,
12 FileViewerTitle,
13 FileViewerInset,
14 FileViewerProvider,
15 FileViewerViewport,
16} from "./file-viewer";
17import {
18 PdfResourceContent,
19 type PdfResourceContentProps,
20 type PdfViewerContentProps,
21} from "./pdf-viewer-content";
22import {
23 PdfViewerPages,
24 PdfViewerProvider,
25 type PdfDocumentSource,
26} from "./pdf-viewer-context";
27import type { PdfViewerHandle } from "./pdf-viewer-types";
28
29export type {
30 PageOverlayProps,
31 PdfPageAreaTarget,
32 PdfPageRenderSource,
33 PdfPageRenderStatus,
34 PdfPageRenderTiming,
35 PdfViewerHandle,
36 PdfViewerPerformanceOptions,
37} from "./pdf-viewer-types";
38export {
39 PdfViewerPages,
40 PdfViewerProvider,
41 usePdfViewerThumbnails,
42 type PdfDocumentSource,
43} from "./pdf-viewer-context";
44export {
45 PdfResourceContent,
46 type PdfResourceContentProps,
47 type PdfViewerContentProps,
48} from "./pdf-viewer-content";
49export {
50 PdfThumbnailRail,
51 PdfViewerThumbnails,
52 type PdfThumbnailRailProps,
53 type PdfViewerThumbnailsProps,
54} from "./pdf-viewer-thumbnails";
55
56export interface PdfHighlightProps extends React.ComponentProps<"div"> {
57 /** Normalized box, each field a percentage [0, 100] of the page. */
58 area: { left: number; top: number; width: number; height: number };
59}
60
61export function PdfHighlight({
62 area,
63 className,
64 style,
65 ...props
66}: PdfHighlightProps) {
67 return (
68 <div
69 data-slot="pdf-highlight"
70 className={cn(
71 "border-primary/70 bg-primary/12 pointer-events-none absolute z-10 rounded-[2px] border shadow-[0_4px_16px_rgb(0_0_0_/_8%)]",
72 className,
73 )}
74 style={{
75 left: `${area.left}%`,
76 top: `${area.top}%`,
77 width: `${area.width}%`,
78 height: `${area.height}%`,
79 ...style,
80 }}
81 {...props}
82 />
83 );
84}
85
86export interface PdfViewerProps extends PdfViewerContentProps {
87 /** Canonical PDF source. URL sources preserve PDF.js range-loading behavior. */
88 source: PdfDocumentSource;
89}
90
91export const PdfViewer = React.forwardRef<PdfViewerHandle, PdfViewerProps>(
92 function PdfViewer(props, ref) {
93 const {
94 source,
95 className,
96 bare = false,
97 controls = true,
98 download = true,
99 ...pagesProps
100 } = props;
101 return (
102 <FileViewerProvider source={source}>
103 <FileViewer
104 className={cn(
105 "h-full",
106// … truncated

What it pulls in

npm packages

  • lucide-react

Other registry items

  • @retab/file-viewer
  • @retab/pdf-document-resource
  • @retab/utils
  • button
  • @retab/scroll-area
  • separator
  • @retab/skeleton
  • dropdown-menu
  • @retab/spinner
  • @retab/viewer-controls

Files it writes

  • registry/new-york-v4/ui/pdf-viewer.tsx
  • registry/new-york-v4/ui/pdf-viewer-content.tsx
  • registry/new-york-v4/ui/pdf-viewer-document-controls.ts
  • registry/new-york-v4/ui/pdf-viewer-document-layout.ts
  • registry/new-york-v4/ui/pdf-viewer-document-resource.ts
  • registry/new-york-v4/ui/pdf-viewer-document-runtime.ts
  • registry/new-york-v4/ui/pdf-viewer-pages-layer.tsx
  • registry/new-york-v4/ui/pdf-viewer-render-scheduler.ts
  • registry/new-york-v4/ui/pdf-viewer-render-cache.ts
  • registry/new-york-v4/ui/use-pdf-page-metrics.ts
  • registry/new-york-v4/ui/pdf-viewer-context.tsx
  • registry/new-york-v4/ui/viewer.tsx
  • registry/new-york-v4/ui/viewer-error.tsx
  • registry/new-york-v4/ui/pdf-viewer-types.ts
  • registry/new-york-v4/ui/pdf-viewer-scale.ts
  • registry/new-york-v4/ui/pdf-viewer-scroll.ts
  • registry/new-york-v4/ui/pdf-viewer-zoom-motion.ts
  • registry/new-york-v4/ui/viewer-document-scroll.ts
  • registry/new-york-v4/ui/viewer-document-geometry.ts
  • registry/new-york-v4/ui/pdf-viewer-layout.ts
  • registry/new-york-v4/ui/pdf-viewer-virtualization.ts
  • registry/new-york-v4/ui/pdf-viewer-page-sizes.ts
  • registry/new-york-v4/ui/pdf-viewer-page.tsx
  • registry/new-york-v4/ui/pdf-viewer-canvas.ts
  • registry/new-york-v4/ui/pdf-viewer-render-error.ts
  • registry/new-york-v4/ui/pdf-viewer-states.tsx
  • registry/new-york-v4/ui/pdf-viewer-thumbnails.tsx
  • registry/new-york-v4/ui/pdf-thumbnail-layout.ts
  • registry/new-york-v4/ui/use-pdf-thumbnail-document.ts
  • registry/new-york-v4/ui/use-pdf-thumbnail-page-metrics.ts
  • registry/new-york-v4/ui/use-pdf-thumbnail-window.ts
  • registry/new-york-v4/ui/use-thumbnail-rail-follow.ts
  • registry/new-york-v4/ui/pdf-thumbnail-rail.tsx
  • registry/new-york-v4/ui/pdf-thumbnail-item.tsx
  • registry/new-york-v4/ui/pdf-thumbnail-canvas.tsx
  • registry/new-york-v4/lib/viewer-source.ts
  • registry/new-york-v4/ui/use-is-client.ts
  • registry/new-york-v4/ui/viewer-download.tsx
  • registry/new-york-v4/ui/pdf-viewer-telemetry.ts

Facts

Registry
retab-ui
Type
registry:ui
Access
Free
Files written
39
Licence
NOASSERTION
First indexed
2026-08-03
Last confirmed
yesterday

Go to the source

ui.retab.com retab-dev/retab-ui on GitHub Raw registry item This item as JSON

More from retab-ui

All 130 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Alertalertretab-uiComponentsFree1 dep
Alert Dialogalert-dialogretab-uiComponentsFree1 dep
Aspect Ratioaspect-ratioretab-uiComponentsFreeno deps
Attachment Sidebarattachment-sidebarretab-uiComponentsFree1 dep
Autocompleteautocompleteretab-uiComponentsFree2 deps
Calendarcalendarretab-uiComponentsFree2 deps
Code Viewercode-viewerretab-uiComponentsFree2 deps · 32 files
Commandcommandretab-uiComponentsFree2 deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex