# Slides and Layouts

- Human documentation: [https://docs.univer.ai/guides/slides/features/core/slides-and-layouts](https://docs.univer.ai/guides/slides/features/core/slides-and-layouts)

- Agent Markdown: [https://docs.univer.ai/guides/slides/features/core/slides-and-layouts.md](https://docs.univer.ai/guides/slides/features/core/slides-and-layouts.md)

- Requested language: `en-US`

- Content language: `en-US`

- Documentation version: `1.0.0-rc.0`

- Source: [slides/features/core/slides-and-layouts.mdx](https://github.com/dream-num/documentation/blob/dev/content/guides/slides/features/core/slides-and-layouts.mdx)

---

`FPresentation` manages slide order and the shared page size. `FSlide` exposes the resolved page layout and the background of one slide.

## Manage slide order

```ts
const presentation = univerAPI.getActivePresentation()

if (!presentation) {
  throw new Error('No active presentation')
}

const agenda = presentation.appendSlide({ name: 'Agenda' })
const summary = presentation.insertSlide(1, { name: 'Summary' })

presentation.moveSlide(summary, 0)
presentation.setActiveSlide(agenda)
```

Use `getSlides()`, `getSlideById()`, and `getSlideByIndex()` to read the current order. `deleteSlide()` removes a slide through the command pipeline.

## Set the page size

```ts
presentation.setPageSize({
  preset: univerAPI.Enum.SlidePageSizePresetEnum.WideScreen16By9,
})
```

`slide.getPageLayout()` returns the resolved page size plus the bounds and order of its elements. Coordinates use the Slides model coordinate system.

## Set a slide background

```ts
agenda.setBackground({
  type: univerAPI.Enum.SlideBackgroundTypeEnum.Solid,
  color: '#1d4ed8',
})
```

Set `undefined` to remove an explicit slide background. `setShowMasterBackground(false)` hides inherited master background graphics for that slide without deleting them from the presentation snapshot.
