# PPTX Editor quick start

Install the package, add its styles and mount the editor on a page.

## Install

```bash
pnpm add @quirekit/pptx-editor @quirekit/unocss-preset vue
```

The editor's controls share design tokens and component styles with the other QuireKit editors; `@quirekit/unocss-preset` provides them. Apps without UnoCSS import the compiled `quirekit.css`; apps that already use UnoCSS can instead `export default defineQuireKitUnoConfig()` from `uno.config.ts` and import `virtual:uno.css`.

## Mount

```ts [main.ts]
import { Editor } from '@quirekit/pptx-editor'
import '@quirekit/unocss-preset/quirekit.css'
import '@quirekit/pptx-editor/styles.css'

const editor = new Editor({ licenseKey: null }).mount('#app')
```

`mount()` takes a selector or an element and returns the editor. Without an initial file the editor opens a new presentation with one title slide. The editor fills its container, so give the container a real height:

```css
#app { height: 100vh; }
```

Call `editor.destroy()` when the page or component goes away; it releases the deck, the slide show and every browser listener.

## Interface language

The default is Simplified Chinese. Pass `locale: "en"` to the constructor for English. Users can switch in File → Language, and hosts can call `editor.setLocale("zh-CN")`. Use `onLocaleChange(locale)` to persist choices made in the menu. Switching keeps the open presentation and its edits.

## Vue

The editor can only be created in the browser. Mount it in `onMounted` and destroy it in `onBeforeUnmount`; in Nuxt, wrap the component in `<ClientOnly>` or import it dynamically from a client plugin.

```vue [PptxEditor.vue]
<script setup lang="ts">
import { onBeforeUnmount, onMounted, ref } from 'vue'
import { Editor } from '@quirekit/pptx-editor'
import '@quirekit/unocss-preset/quirekit.css'
import '@quirekit/pptx-editor/styles.css'

const host = ref<HTMLElement>()
let editor: Editor | undefined

onMounted(() => { editor = new Editor({ licenseKey: null }).mount(host.value!) })
onBeforeUnmount(() => editor?.destroy())
</script>

<template>
  <div ref="host" style="height: 100vh" />
</template>
```

## Next

- Open files from your server and save to your own service: [Open and save](/en/pptx/files)
- Read and change slides from code: [Session and commands](/en/pptx/commands)
- Add the AI assistant: [AI assistant](/en/pptx/ai)
