PPTX EditorView Markdown ↗
Side panels
Add your own panel at the right of the editor, with the current session and slide drawings.
The panels option adds buttons to the editor's right toolbar; each opens a panel beside the slide. The AI assistant is added this way, and the host can add its own panels, such as an asset library or an approval log.
ts
import { Editor, type PptxEditorPanel } from '@quirekit/pptx-editor'
const outline: PptxEditorPanel = {
id: 'my-app.outline',
label: 'Outline',
mount(context) {
const element = document.createElement('div')
const render = async () => {
element.textContent = `${context.session.name()} · ${context.session.selection().length} selected`
}
const stop = context.session.subscribe(() => void render())
void render()
return { element, destroy: stop }
},
}
new Editor({ panels: [outline] }).mount('#app')
mountruns the first time the panel opens; its content stays for the life of the editor and is not rebuilt when the panel reopens.context.sessionis the current session;context.renderSlide(part)returns the editor's SVG drawing of a slide andcontext.pictureSlide(part, width)returns PNG bytes, for thumbnails or exports.context.close()closes the panel.layoutsdeclares the layouts the panel supports (side,wide, andpage, which takes the main area with the slide previewed beside it); the panel switches withcontext.setLayout().iconsets the toolbar button icon anddefaultOpen: trueopens the panel when the editor mounts.