ReferenceAPI
Layouts, masters and themes
The deck's layouts and masters, and its theme.
The deck’s layouts and masters, and its theme. The same text agents read through help().
theme.colors
Section titled “theme.colors”Color slots (dk1, lt1, dk2, lt2, accent1–6, hlink, folHlink) as hex.
theme.dark
Section titled “theme.dark”dark: booleanLight text on a dark background: decks get PowerPoint’s dark color mapping (bg1 = dk1, tx1 = lt1).
theme.fonts
Section titled “theme.fonts”Heading and body font families.
theme.name
Section titled “theme.name”name: stringTheme name shown in PowerPoint’s Design tab.
theme.preset
Section titled “theme.preset”preset: string | undefinedThe preset last applied with use() (“ledger”, or a defineTheme name), if any.
theme.set
Section titled “theme.set”set(options: ThemeOptions): thisUpdates the theme; slots you leave out keep their current value. When colors change, the recipes’ text shades follow so text stays readable (muted text, the label above titles, table header text).
Options: ThemeOptions.
theme.style
Section titled “theme.style”Styling compose recipes take from the theme: title and eyebrow classes, number weight, corner radii.
theme.use
Section titled “theme.use”use(theme: ThemePresetName | ThemePreset | string): thisApplies a theme preset: its colors, fonts and recipe styling, all at once.
deck.theme.use("ledger"), or deck.theme.use(defineTheme({ brand: "#0B5FFF" })).
Built-in presets: classic (the default), spruce, ledger, studio, coast.
Options: ThemePresetName, ThemePreset.
deck.theme.use("ledger")deck.theme.use(defineTheme({ brand: "#0B5FFF" }))layout.background
Section titled “layout.background”background: string | undefinedBackground paint for slides on this layout; undefined uses the master’s.
layout.charts
Section titled “layout.charts”Add charts to the layout, as on a slide: layout.charts.add(...).
layout.charts.add(...)layout.charts.add
Section titled “layout.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] }] })layout.charts.items
Section titled “layout.charts.items”items: Chart[]Charts, back to front.
layout.charts.length
Section titled “layout.charts.length”length: numberHow many there are.
layout.elements
Section titled “layout.elements”elements: SlideElement[]Decorations drawn on every slide that uses this layout, back to front.
layout.images
Section titled “layout.images”Add pictures to the layout, as on a slide: layout.images.add(...).
layout.images.add(...)layout.images.add
Section titled “layout.images.add”add(options: ImageOptions): PictureAdds a picture from a path, bytes, data URL or SVG.
Options: ImageOptions.
layout.images.items
Section titled “layout.images.items”items: Picture[]Pictures, back to front.
layout.images.length
Section titled “layout.images.length”length: numberHow many there are.
layout.key
Section titled “layout.key”key: stringThe layout key used by slides.add({ layout }), e.g. “title-and-content”.
slides.add({ layout })layout.name
Section titled “layout.name”name: stringDisplay name, e.g. “Title and Content”.
layout.placeholderNames
Section titled “layout.placeholderNames”placeholderNames: string[]Placeholder names this layout offers, e.g. [“title”, “body”].
layout.set
Section titled “layout.set”set(options: { background?: string }): thisSets the layout background: layout.set({ background: "slate-50" }).
layout.set({ background: "slate-50" })layout.shapes
Section titled “layout.shapes”Add shapes to the layout, as on a slide: layout.shapes.add(...).
layout.shapes.add(...)layout.shapes.add
Section titled “layout.shapes.add”add(options: ShapeOptions): ShapeAdds a shape, text box or custom path. Invalid options throw immediately.
Options: ShapeOptions.
layout.shapes.items
Section titled “layout.shapes.items”items: Shape[]Shapes and text boxes, back to front.
layout.shapes.length
Section titled “layout.shapes.length”length: numberHow many there are.
layout.slideSize
Section titled “layout.slideSize”slideSize: SizeSlide size in px.
layout.tables
Section titled “layout.tables”Add tables to the layout, as on a slide: layout.tables.add(...).
layout.tables.add(...)layout.tables.add
Section titled “layout.tables.add”add(options: TableOptions): TableAdds a native, editable table.
Options: TableOptions.
layout.tables.items
Section titled “layout.tables.items”items: Table[]Tables, back to front.
layout.tables.length
Section titled “layout.tables.length”length: numberHow many there are.
artiwright.defineTheme
Section titled “artiwright.defineTheme”defineTheme(options: DefineThemeOptions): ThemePresetA full theme from a brand’s colors: give the brand color, and any of accent, palette, text,
background, surface, good and bad; the rest is derived. Text always gets a readable shade.
deck.theme.use(artiwright.defineTheme({ brand: "#FF385C", text: "#222222" })).
Options: DefineThemeOptions.
deck.theme.use(artiwright.defineTheme({ brand: "#FF385C", text: "#222222" }))master.charts
Section titled “master.charts”Add charts to the master, shown on every slide: master.charts.add(...).
master.charts.add(...)master.charts.add
Section titled “master.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] }] })master.charts.items
Section titled “master.charts.items”items: Chart[]Charts, back to front.
master.charts.length
Section titled “master.charts.length”length: numberHow many there are.
master.elements
Section titled “master.elements”elements: SlideElement[]Decorations drawn behind every slide (logos, rules), back to front.
master.images
Section titled “master.images”Add pictures to the master, shown on every slide: master.images.add(...).
master.images.add(...)master.images.add
Section titled “master.images.add”add(options: ImageOptions): PictureAdds a picture from a path, bytes, data URL or SVG.
Options: ImageOptions.
master.images.items
Section titled “master.images.items”items: Picture[]Pictures, back to front.
master.images.length
Section titled “master.images.length”length: numberHow many there are.
master.set
Section titled “master.set”set(options: MasterOptions): thisChanges the master background, text styles or bullets. Applies to every layout and slide.
Options: MasterOptions.
master.shapes
Section titled “master.shapes”Add shapes to the master, shown on every slide: master.shapes.add(...).
master.shapes.add(...)master.shapes.add
Section titled “master.shapes.add”add(options: ShapeOptions): ShapeAdds a shape, text box or custom path. Invalid options throw immediately.
Options: ShapeOptions.
master.shapes.items
Section titled “master.shapes.items”items: Shape[]Shapes and text boxes, back to front.
master.shapes.length
Section titled “master.shapes.length”length: numberHow many there are.
master.tables
Section titled “master.tables”Add tables to the master, shown on every slide: master.tables.add(...).
master.tables.add(...)master.tables.add
Section titled “master.tables.add”add(options: TableOptions): TableAdds a native, editable table.
Options: TableOptions.
master.tables.items
Section titled “master.tables.items”items: Table[]Tables, back to front.
master.tables.length
Section titled “master.tables.length”length: numberHow many there are.