// NOTE: previous {create-react-app} is webpack-based and will use package.json `module: "dist/pptxgen.es.js"` value // NOTE: this Vite+React demo is using `main: "dist/pptxgen.cjs.js"` value, so we hard-code below to TEST /* // @ts-expect-error (manually import the es module for TESTING!) */ //import pptxgen from "pptxgenjs/dist/pptxgen.cjs.js"; import pptxgen from "pptxgenjs"; import { testMainMethods, testTableMethod } from "./tstest/Test"; import { demoCode } from "./enums"; import logo from "./assets/logo.png"; import './scss/styles.scss'; function App() { function runDemo() { const pptx = new pptxgen(); const slide = pptx.addSlide(); const dataChartRadar = [ { name: "Region 1", labels: ["May", "June", "July", "August", "September"], values: [26, 53, 100, 75, 41], }, ]; //slide.addChart(pptx.ChartType.radar, dataChartRadar, { x: 0.36, y: 2.25, w: 4.0, h: 4.0, radarStyle: "standard" }); //slide.addShape(pptx.ShapeType.rect, { x: 4.36, y: 2.36, w: 5, h: 2.5, fill: pptx.SchemeColor.background2 }); //slide.addText("React Demo!", { x: 1, y: 1, w: "80%", h: 1, fontSize: 36, fill: "eeeeee", align: "center" }); slide.addText("React Demo!", { x: 1, y: 0.5, w: "80%", h: 1, fontSize: 36, align: "center", fill: { color: "D3E3F3" }, color: "008899", }); slide.addChart(pptx.ChartType.radar, dataChartRadar, { x: 1, y: 1.9, w: 8, h: 3 }); slide.addText(`PpptxGenJS version: ${pptx.version}`, { x: 0, y: 5.3, w: "100%", h: 0.33, fontSize: 10, align: "center", fill: { color: "E1E1E1" }, //{ color: pptx.SchemeColor.background2 }, color: "A1A1A1", // pptx.SchemeColor.accent3, }); pptx.writeFile({ fileName: "pptxgenjs-demo-react.pptx" }); } const htmlNav = () => { return } const htmlMain = () => { return

Module Demo

Sample React+TypeScript+Vite application demonstrating the PptxGenJS library as a module.
Demo Code (.tsx)
						{demoCode}
					
col 1 col 2 col 3
cell 1 cell 2 cell 3
} return (
{htmlNav()} {htmlMain()}
); } export default App