Skip to content

ReferenceAPI

Layouts, masters and themes

The deck's layouts and masters, and its theme.

Layouts, masters and themes.md

The deck’s layouts and masters, and its theme. The same text agents read through help().

Color slots (dk1, lt1, dk2, lt2, accent1–6, hlink, folHlink) as hex.

dark: boolean

Light text on a dark background: decks get PowerPoint’s dark color mapping (bg1 = dk1, tx1 = lt1).

Heading and body font families.

name: string

Theme name shown in PowerPoint’s Design tab.

preset: string | undefined

The preset last applied with use() (“ledger”, or a defineTheme name), if any.

set(options: ThemeOptions): this

Updates 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.

Styling compose recipes take from the theme: title and eyebrow classes, number weight, corner radii.

use(theme: ThemePresetName | ThemePreset | string): this

Applies 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" }))
background: string | undefined

Background paint for slides on this layout; undefined uses the master’s.

Add charts to the layout, as on a slide: layout.charts.add(...).

layout.charts.add(...)
add(type: ChartType, options: ChartOptions): Chart

Adds 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] }] })
items: Chart[]

Charts, back to front.

length: number

How many there are.

elements: SlideElement[]

Decorations drawn on every slide that uses this layout, back to front.

Add pictures to the layout, as on a slide: layout.images.add(...).

layout.images.add(...)
add(options: ImageOptions): Picture

Adds a picture from a path, bytes, data URL or SVG.

Options: ImageOptions.

items: Picture[]

Pictures, back to front.

length: number

How many there are.

key: string

The layout key used by slides.add({ layout }), e.g. “title-and-content”.

slides.add({ layout })
name: string

Display name, e.g. “Title and Content”.

placeholderNames: string[]

Placeholder names this layout offers, e.g. [“title”, “body”].

set(options: { background?: string }): this

Sets the layout background: layout.set({ background: "slate-50" }).

layout.set({ background: "slate-50" })

Add shapes to the layout, as on a slide: layout.shapes.add(...).

layout.shapes.add(...)
add(options: ShapeOptions): Shape

Adds a shape, text box or custom path. Invalid options throw immediately.

Options: ShapeOptions.

items: Shape[]

Shapes and text boxes, back to front.

length: number

How many there are.

slideSize: Size

Slide size in px.

Add tables to the layout, as on a slide: layout.tables.add(...).

layout.tables.add(...)
add(options: TableOptions): Table

Adds a native, editable table.

Options: TableOptions.

items: Table[]

Tables, back to front.

length: number

How many there are.

defineTheme(options: DefineThemeOptions): ThemePreset

A 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" }))

Add charts to the master, shown on every slide: master.charts.add(...).

master.charts.add(...)
add(type: ChartType, options: ChartOptions): Chart

Adds 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] }] })
items: Chart[]

Charts, back to front.

length: number

How many there are.

elements: SlideElement[]

Decorations drawn behind every slide (logos, rules), back to front.

Add pictures to the master, shown on every slide: master.images.add(...).

master.images.add(...)
add(options: ImageOptions): Picture

Adds a picture from a path, bytes, data URL or SVG.

Options: ImageOptions.

items: Picture[]

Pictures, back to front.

length: number

How many there are.

set(options: MasterOptions): this

Changes the master background, text styles or bullets. Applies to every layout and slide.

Options: MasterOptions.

Add shapes to the master, shown on every slide: master.shapes.add(...).

master.shapes.add(...)
add(options: ShapeOptions): Shape

Adds a shape, text box or custom path. Invalid options throw immediately.

Options: ShapeOptions.

items: Shape[]

Shapes and text boxes, back to front.

length: number

How many there are.

Add tables to the master, shown on every slide: master.tables.add(...).

master.tables.add(...)
add(options: TableOptions): Table

Adds a native, editable table.

Options: TableOptions.

items: Table[]

Tables, back to front.

length: number

How many there are.