---
title: "Viewer — React"
description: "A complete PDF viewer you add with one tag, then make your own with a few lines of config, in plain HTML, React, Vue, Svelte or Angular."
integration: "React"
other_integrations:
  "Vanilla JS": "https://www.cloudpdf.com/docs/viewer/vanilla.md"
  "Vue": "https://www.cloudpdf.com/docs/viewer/vue.md"
  "Svelte": "https://www.cloudpdf.com/docs/viewer/svelte.md"
  "Angular": "https://www.cloudpdf.com/docs/viewer/angular.md"
source: "https://www.cloudpdf.com/docs/viewer/react"
---

# A complete PDF viewer, ready to embed

The viewer is everything people expect from a PDF app, in one tag: a toolbar, thumbnails, search,
annotations, comments, forms, signatures and stamps. It fits a phone and a wide screen, speaks the
user's language, and works with a keyboard and a screen reader.

**`first.tsx`**

```tsx
import { PDFViewer } from '@cloudpdf/viewer-react';

export function App() {
  return <PDFViewer src={{ grant: 'shr_gvpJcG1ULUMon19C0D1wODSY' }} style={{ height: '100vh' }} />;
}
```

That's the whole integration. The rest of these docs are about making it yours.

## Make it yours

Everything you change is a few lines of config, the same in every framework. Start at the top and
stop when it's enough:

- [Match your brand](https://www.cloudpdf.com/docs/viewer/react/customize/theming.md) — Your accent color, fonts, and light or dark.
- [Turn features on and off](https://www.cloudpdf.com/docs/viewer/react/features/turning-off.md) — Hide comments, add measurement, or make it read-only.
- [Arrange the toolbars](https://www.cloudpdf.com/docs/viewer/react/customize/layout.md) — Move or remove buttons, and put toolbars on any edge.
- [Add your own button](https://www.cloudpdf.com/docs/viewer/react/customize/commands.md) — A command: a label, an icon, and what it does.
- [Add a menu](https://www.cloudpdf.com/docs/viewer/react/customize/menus.md) — A list of items that opens from a button.
- [Add a panel](https://www.cloudpdf.com/docs/viewer/react/customize/panels.md) — Your own list or component next to the pages.
- [Use your own components](https://www.cloudpdf.com/docs/viewer/react/customize/components.md) — Your React, Vue, Svelte or Angular component in the toolbar.
- [Control it from your app](https://www.cloudpdf.com/docs/viewer/react/code/viewer.md) — Open documents, run commands, and follow what happens.

You never write layout code for phones, menus that open the right way, or keyboard focus. You say
what goes where, and the viewer takes care of how it behaves. A menu in a bottom toolbar opens
upward; the thumbnails slide up from the bottom on a phone; a button that doesn't fit moves into
the "More" menu.

## The viewer or headless?

EmbedPDF comes in two forms, built on the same engine and the same plugins:

- **The viewer** is finished. You configure it, theme it, and add your own buttons, menus, panels
  and components.
- **[Headless](https://www.cloudpdf.com/docs/headless/react.md)** is the parts. You build the whole interface yourself, and
  nothing appears on screen unless you put it there.

Start with the viewer. Every feature is a [headless plugin](https://www.cloudpdf.com/docs/viewer/react/code/plugins.md) with the same settings,
and inside the viewer your own components can use the headless hooks. If you outgrow the viewer,
what you learned still applies.

## The CloudPDF viewer

The file stays on your server. Pages arrive as images, so the first page shows at once; every
action is checked against the user's token; and annotations, comments and form values are stored
as people make them, with everyone who has the document open seeing each other's changes.

It is the same viewer as [EmbedPDF's](https://www.embedpdf.com/docs/viewer/react.md), with CloudPDF as its
engine: the same component, config and names. Moving from one to the other, you change the package
you import and what `src` is.

## Next steps

- [Quick start](https://www.cloudpdf.com/docs/viewer/react/quick-start.md) — Install, show a PDF, add your color and your own button.
- [Layout](https://www.cloudpdf.com/docs/viewer/react/customize/layout.md) — Toolbars at any edge, several of them, and every button where you want it.
- [Your own components](https://www.cloudpdf.com/docs/viewer/react/customize/components.md) — Your React, Vue, Svelte or Angular components inside the viewer.
