Skip to main content

Slide Sections

Group slides using sections.

Syntax

pptx.addSection({ title: "Tables" });
pptx.addSection({ title: "Tables", order: 3 });

Section Options

OptionTypeDescriptionPossible Values
titlestringsection title0-n OR 'n%'. (Ex: {x:'50%'} will place object in the middle of the Slide)
orderintegersection order1-n. Used to add section at any index

Section Example

import pptxgen from "pptxgenjs";
let pptx = new pptxgen();

// STEP 1: Create a section
pptx.addSection({ title: "Tables" });

// STEP 2: Provide section title to a slide that you want in corresponding section
let slide = pptx.addSlide({ sectionTitle: "Tables" });

slide.addText("This slide is in the Tables section!", { x: 1.5, y: 1.5, fontSize: 18, color: "363636" });
pptx.writeFile({ fileName: "Section Sample.pptx" });