EmbedPDF
React PDF Viewer Open Source Library

React PDF Viewer

built your way

The ultimate React PDF viewer for your next project. Choose our pre-built viewer for instant results, or use our headless components to build a completely custom UI.

Works seamlessly with your favorite libraries

Material UI
Chakra UI
Tailwind CSS
shadcn/ui
Ant Design
Radix UI

Two ways to integrate

Choose the level of control that fits your project

Full-UI Viewer

Fastest Integration

A complete, polished PDF viewer with toolbar and thumbnails. Drop it in and you're done.

  • Pre-built responsive UI
  • Zero configuration
  • Production ready
npm install @embedpdf/react-pdf-viewer

Headless Components

Ultimate Flexibility

Use our powerful components to build a viewer that perfectly matches your design system.

  • 100% UI Freedom
  • Tiny bundle size
  • Modular plugin system
npm install @embedpdf/core
Full-UI Component

Drop-in Integration

Get a fully featured PDF viewer in your React app with just a few lines of code.

App.tsx
import { PDFViewer } from '@embedpdf/react-pdf-viewer';

export default function App() {
  return (
    <PDFViewer
      config={{ src: 'https://snippet.embedpdf.com/ebook.pdf' }}
      style={{ height: '500px' }}
      onReady={(registry) => {
        console.log('PDF viewer ready!', registry);
      }}
    />
  );
}

See it in Action

This is the default UI you get with the <PDFViewer /> component.
Want a different look? Scroll down to see our headless architecture.

Loading PDF Viewer...
Headless Architecture

Compose Your Perfect Viewer

Pick only the features you need. Each plugin is a separate package—your bundle stays lean, your app stays fast.

Core Foundation
Document Manager
@embedpdf/plugin-document-manager
Viewport
@embedpdf/plugin-viewport
Scroll
@embedpdf/plugin-scroll
Render
@embedpdf/plugin-render
Feature Plugins
Zoom
Selection
Annotation
Thumbnail
Search
Rotate
Pan
Print
Export
Capture
Redaction
i18n
PDFViewer.tsx

import { EmbedPDF, createPluginRegistration }

from '@embedpdf/core/react';

import { ZoomPluginPackage, useZoom }

from '@embedpdf/plugin-zoom/react';

// Register only what you need

const plugins = [

createPluginRegistration(DocumentManagerPluginPackage),

createPluginRegistration(ZoomPluginPackage, {

defaultZoomLevel: ZoomMode.FitPage

}),

];

// Build your own UI with hooks

const { zoomIn, zoomOut, currentZoomLevel } = useZoom(documentId);

Zero UI opinions

Use useZoom(), useSelection(), or any hook with your own buttons, sliders, and components.

Built for the Modern Stack

Technical excellence you can rely on. Designed for high-performance applications.

First-Class TypeScript

Not an afterthought. Every prop, hook, and event is fully typed, giving you a superior developer experience with robust autocomplete.

interface ViewerProps {
onPageChange?: (page: number) => void;
}

Virtualization Engine

Handle documents with thousands of pages. We only render what is visible in the viewport, keeping your application memory usage low and frame rates high.

SSR & Next.js Ready

Works seamlessly with Server Side Rendering. Components handle client-only logic gracefully, so you don't have to fight with hydration errors.

Modular & Tree-Shakeable

Don't ship a 5MB viewer when you only need to show a simple invoice. Our modular architecture means you import only the parts you need, keeping your initial bundle size tiny.

Core Viewer~25kb (gzipped)
Typical PDF Viewer~500kb+

Common Questions

Everything you need to know about integrating the viewer.

How is this different from react-pdf?

Most React libraries wrap PDF.js. EmbedPDF uses a custom WebAssembly engine powered by PDFium (Google Chrome's PDF engine). This delivers significantly faster rendering, better accuracy, and a true headless architecture that gives you full UI control.

Does it work with Next.js App Router (RSC)?

Yes! All components are designed to work seamlessly with Next.js. We handle the client-side browser APIs (like Canvas) gracefully, so you don't get hydration mismatches. Just import our components in your Client Components.

Can I style it with Tailwind CSS?

Absolutely. Since our headless components don't render any opinionated styles, you have full control. You can pass Tailwind classes directly to our viewport, layers, and custom toolbar buttons.

Do I need a server or API key?

No. The viewer runs entirely in the user's browser using WebAssembly. Your documents stay on the client, and you don't need to pay for any cloud processing or manage API keys.

How does it handle large PDF files?

We use a virtualization engine (similar to react-window) that only renders the pages currently visible in the viewport. This keeps memory usage low and scrolling smooth, even for documents with 1000+ pages.

Is it free for commercial projects?

Yes. The core library and all standard plugins are MIT licensed. You can use them in personal, commercial, and enterprise projects without any restrictions or hidden fees.

Ready to build your PDF viewer?

Join thousands of developers using EmbedPDF to create amazing experiences.