> ## Documentation Index
> Fetch the complete documentation index at: https://docs.doconda.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How do I view or edit a PowerPoint (PPTX) file in React?

> Render DocondaEditor with a .pptx: users view, edit and present the slides on your site, in the browser. With readOnly, they only view them.

Use Doconda's editor plugin, `@doconda/editor`, and pass the `.pptx` in `src`. The slides show inside your site, where
users can edit and present them full screen; with `readOnly` they only view them. Everything runs in the browser: the
file isn't uploaded anywhere to be edited.

## Add a PowerPoint viewer or editor

1. Get the plugin in the dashboard, under **Editor**, with a 7-day free trial. See
   [licence and domains](https://docs.doconda.com/editor/license.md).
2. Install it with the command the dashboard gives you (it needs React 19 or later):

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
# .npmrc with the registry and token from the dashboard (Editor)
npm install @doconda/editor
```

3. Put the editor in a container with a height and pass it the `.pptx` link:

```tsx theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
import { DocondaEditor } from "@doconda/editor"

export function Slides({ url }: { url: string }) {
  return (
    <div style={{ height: 700, display: "flex" }}>
      <DocondaEditor src={url} licenseKey="ek_eu_…" className="flex-1" />
    </div>
  )
}
```

4. For a viewer only, add `readOnly`:

```tsx theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
<DocondaEditor src={url} licenseKey="ek_eu_…" readOnly />
```

`src` must be a file the browser can download: from your site, or from a server that allows it with CORS. If the link
has no extension, pass `format="slide"`.

## What it does with a PowerPoint file

* **Slides**: new, duplicate, hide, layout, background and sections; master, layouts and themes.
* **Content**: text with its styles, shapes, connectors, images, tables and charts.
* **Motion**: transitions, animations and speaker notes.
* **View**: zoom, present full screen and print.

In `readOnly` mode the toolbars disappear, but users can still move between slides, copy text and present. Whatever the
editor can't edit, charts included, is saved as it was.

## Remove what you don't need

`toolbar` takes a function that filters the default groups (the ones for a selection start with `@`), and `false`
removes the bottom bar or the right-click menu:

```tsx theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
const hide = ["comment", "comments", "transition", "animation", "slideshow"]

<DocondaEditor
  src={url}
  toolbar={(groups) => groups.filter((g) => !g[0]?.startsWith("@")).map((g) => g.filter((id) => !hide.includes(id)))}
/>
```

See [remove parts](https://docs.doconda.com/editor/customize.md#remove-parts).

## Save the edited file

Get the file through a `ref`:

```tsx theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
import { useRef } from "react"
import { DocondaEditor, type EditorHandle } from "@doconda/editor"

const editor = useRef<EditorHandle>(null)

<DocondaEditor ref={editor} src={url} licenseKey="ek_eu_…" />

const bytes = await editor.current!.save() // Uint8Array with the edited .pptx
```

## FAQ

> [accordion] Does it open old .ppt files?
>
> Yes. It opens `.pptx`, `.ppsx`, `.ppt`, `.pps` and `.pot`, plus `.odp`, which it converts first. Saving gives a
> `.pptx`.

> [accordion] Can I switch to edit mode without reloading?
>
> Yes. `readOnly` can change at any time without reopening the file. See
> [DOCX viewer for React](https://docs.doconda.com/answers/docx-viewer-react.md).

> [accordion] Can the editor be in Spanish or English?
>
> Yes. `locale` takes `"es"` or `"en"`; without it, the browser's language is used. `labels` changes any text.

To make the deck itself with an API call, see [generate a PowerPoint from a prompt](https://docs.doconda.com/answers/powerpoint-from-prompt-api.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.