Slide Pages and Elements
ISlidePage
ISlidePage describes a single page-like object in Univer Slides. Normal slides, masters, layouts, handout masters, and notes masters all use this structure and differ by pageType and their optional property block.
Page Properties
| Property | Type | Description |
|---|---|---|
| id | string | Unique page id. |
| pageType | PageType | Page kind, such as SLIDE, MASTER, or LAYOUT. |
| zIndex | number | Render order of the page. |
| title | string | Page title. |
| description | string | Page description. |
| pageBackgroundFill | IColorStyle | Page background fill. |
| colorScheme? | ThemeColorType | Theme color scheme used by the page. |
| pageElements | { [elementId: string]: IPageElement } | Elements on this page, keyed by element id. |
| slideProperties? | ISlideProperties | Properties for normal slide pages. |
| layoutProperties? | ILayoutProperties | Properties for layout pages. |
| masterProperties? | IMasterProperties | Properties for master pages. |
IPageElement
IPageElement is the common element container. Every element has transform fields such as left, top, width, height, angle, scaleX, scaleY, flipX, and flipY, plus one content payload selected by type.
| Element type | Payload | Description |
|---|---|---|
PageElementType.SHAPE | shape | Preset or custom shape, including shape text and shape properties. |
PageElementType.IMAGE | image | Image properties and optional placeholder/link metadata. |
PageElementType.TEXT | richText | Rich-text element. The rich field can store IDocumentData. |
PageElementType.SPREADSHEET | spreadsheet | Deprecated embedded worksheet payload. |
PageElementType.DOCUMENT | document | Deprecated embedded document payload. |
PageElementType.SLIDE | slide | Deprecated embedded slide payload. |
Example
TypeScript
const page: ISlidePage = { id: 'slide-1', pageType: PageType.SLIDE, zIndex: 10, title: 'Agenda', description: '', pageBackgroundFill: { rgb: 'rgb(255,255,255)' }, pageElements: { title: { id: 'title', zIndex: 1, left: 72, top: 64, width: 600, height: 80, title: 'Title', description: '', type: PageElementType.TEXT, richText: { text: 'Quarterly Review', }, }, },}Notes
pageOrdercontrols visible slide order;zIndexcontrols drawing order.- Text elements can store plain
textor richer document data throughrichText.rich. - Use
customBlockfor plugin-owned element payloads instead of overloading deprecated embedded payloads.
How is this guide?