ReferenceAPI
Slides
A slide's shapes, charts, tables, pictures, placeholders and notes.
A slide’s shapes, charts, tables, pictures, placeholders and notes. The same text agents read through help().
slide.background
Section titled “slide.background”background: string | undefinedBackground paint (color token, hex or gradient); undefined inherits the layout’s.
slide.bringForward
Section titled “slide.bringForward”bringForward(target: SlideElement | string): voidMoves an element one step forward.
Options: SlideElement.
slide.bringToFront
Section titled “slide.bringToFront”bringToFront(target: SlideElement | string): voidMoves an element in front of everything else.
Options: SlideElement.
slide.charts
Section titled “slide.charts”Native charts: slide.charts.add("column", { frame, categories, series }).
slide.charts.add("column", { frame, categories, series })slide.charts.add
Section titled “slide.charts.add”add(type: ChartType, options: ChartOptions): ChartAdds a native, editable chart. “column” is vertical bars, “bar” horizontal bars:
charts.add("column", { frame, categories: ["Q1", "Q2"], series: [{ name: "ARR", values: [4, 6] }] }).
Options: ChartType, ChartOptions.
charts.add("column", { frame, categories: ["Q1", "Q2"], series: [{ name: "ARR", values: [4, 6] }] })slide.charts.items
Section titled “slide.charts.items”items: Chart[]Charts, back to front.
slide.charts.length
Section titled “slide.charts.length”length: numberHow many there are.
slide.clear
Section titled “slide.clear”clear(): voidRemoves everything on the slide (shapes, charts, tables, pictures, connectors, and what was put
in its placeholders) and keeps its layout, background and notes, so it can be composed again:
slide.clear(); compose(slide, h(TitleBullets, { … })).
slide.clear(); compose(slide, h(TitleBullets, { … }))slide.comment
Section titled “slide.comment”comment(text: string, options: { target?: SlideElement | string; at?: { x: number; y: number }; author?: string; replies?: Array<string | { text: string; author?: string }>; resolved?: boolean; } = {}): SlideCommentStarts a comment thread, on the slide or on one of its objects:
slide.comment("Is this audited?", { target: chart, replies: ["Yes, Q3 close"] }).
The author is the deck’s current one (deck.comments.setAuthor) unless you name another.
Options: SlideElement.
slide.comment("Is this audited?", { target: chart, replies: ["Yes, Q3 close"] })slide.comments
Section titled “slide.comments”comments: SlideComment[]Comment threads on this slide, oldest first.
slide.connect
Section titled “slide.connect”connect(from: SlideElement | string, to: SlideElement | string, options: ConnectOptions = {}): ConnectorDraws a connector glued to two elements, so it follows them when they move in PowerPoint.
slide.connect(a, b, { kind: "elbow" }). The connector sits just behind both elements.
Options: SlideElement, ConnectOptions.
slide.connect(a, b, { kind: "elbow" })slide.elements
Section titled “slide.elements”elements: SlideElement[]Every element in z-order, back to front (placeholders included).
slide.export
Section titled “slide.export”export(options: { format: "layout" }): SlideLayoutExportThe slide as data. format: "layout" returns every element’s box and every wrapped line of text,
exactly as rendered, so placement and overflow can be checked without looking at pixels.
slide.find
Section titled “slide.find”find(target: SlideElement | string): SlideElement | undefinedFinds an element by reference or anchor id (e.g. “sh_7Q2M4K9A”), including inside groups.
Options: SlideElement.
slide.footer
Section titled “slide.footer”footer: booleanSet to false to hide the deck footer on this slide.
slide.group
Section titled “slide.group”group(members: Array<SlideElement | string>, options: { name?: string } = {}): GroupGroups top-level elements so they move and scale together. The group takes the back-most member’s place.
Options: SlideElement.
slide.id
Section titled “slide.id”id: stringAgent-facing anchor, e.g. sl_7Q2M4K9A.
slide.images
Section titled “slide.images”Pictures: slide.images.add({ source, frame, fit: "cover" }).
slide.images.add({ source, frame, fit: "cover" })slide.images.add
Section titled “slide.images.add”add(options: ImageOptions): PictureAdds a picture from a path, bytes, data URL or SVG.
Options: ImageOptions.
slide.images.items
Section titled “slide.images.items”items: Picture[]Pictures, back to front.
slide.images.length
Section titled “slide.images.length”length: numberHow many there are.
slide.layout
Section titled “slide.layout”layout: LayoutThe layout this slide uses.
slide.notes
Section titled “slide.notes”notes: TextInput | undefinedSpeaker notes, shown in presenter view.
slide.placeholders
Section titled “slide.placeholders”The layout’s placeholder slots: slide.placeholders.get("title").setText("Q3").
slide.placeholders.get("title").setText("Q3")slide.placeholders.get
Section titled “slide.placeholders.get”get(name: string): PlaceholderSlotA placeholder slot by name, e.g. “title”, “body”, “left”, “picture”.
slide.placeholders.names
Section titled “slide.placeholders.names”names: string[]Names of the placeholders this slide’s layout offers.
slide.remove
Section titled “slide.remove”remove(target: SlideElement | string): voidDeletes an element (by reference or anchor id). Connectors attached to it go too, since they would be left pointing at nothing. Inside a group, the group must keep at least two members.
Options: SlideElement.
slide.render
Section titled “slide.render”render(options: RenderOptions = {}): Promise<Uint8Array>Renders this slide to an image (PNG by default), as the agent’s preview.
Options: RenderOptions.
slide.sendBackward
Section titled “slide.sendBackward”sendBackward(target: SlideElement | string): voidMoves an element one step back.
Options: SlideElement.
slide.sendToBack
Section titled “slide.sendToBack”sendToBack(target: SlideElement | string): voidMoves an element behind everything else.
Options: SlideElement.
slide.shapes
Section titled “slide.shapes”Shapes and text boxes: slide.shapes.add({ frame, text, fill }).
slide.shapes.add({ frame, text, fill })slide.shapes.add
Section titled “slide.shapes.add”add(options: ShapeOptions): ShapeAdds a shape, text box or custom path. Invalid options throw immediately.
Options: ShapeOptions.
slide.shapes.items
Section titled “slide.shapes.items”items: Shape[]Shapes and text boxes, back to front.
slide.shapes.length
Section titled “slide.shapes.length”length: numberHow many there are.
slide.tables
Section titled “slide.tables”Native tables: slide.tables.add({ frame, rows }).
slide.tables.add({ frame, rows })slide.tables.add
Section titled “slide.tables.add”add(options: TableOptions): TableAdds a native, editable table.
Options: TableOptions.
slide.tables.items
Section titled “slide.tables.items”items: Table[]Tables, back to front.
slide.tables.length
Section titled “slide.tables.length”length: numberHow many there are.
placeholder.element
Section titled “placeholder.element”element: SlideElement | undefinedThe element filling this slot, if any.
placeholder.frame
Section titled “placeholder.frame”frame: FrameThe layout’s frame for this slot, in px.
placeholder.name
Section titled “placeholder.name”name: stringThe slot name, e.g. “title”, “body” or “picture”.
placeholder.set
Section titled “placeholder.set”set(content: PlaceholderContent): SlideElementFills the slot from any PlaceholderContent value.
Options: PlaceholderContent.
placeholder.setImage
Section titled “placeholder.setImage”setImage(source: ImageOptions["source"], options: Omit<ImageOptions, "source" | "frame"> = {}): PictureFills a picture or content slot with an image, fitted to the slot’s frame.
Options: ImageOptions.
placeholder.setText
Section titled “placeholder.setText”setText(text: TextInput, options: { textStyle?: string | TextStyle; textBox?: TextBoxOptions; frame?: Frame } = {}): ShapeFills the slot with text. The text inherits the layout’s position and master styles.
Options: TextInput, TextStyle, TextBoxOptions, Frame.