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 shared container for all elements on a page. Every element has a set of transform fields (left, top, width, height, angle, scaleX, scaleY, flipX, flipY) and exactly one content payload selected by type.
| Element type | Payload | Description |
|---|---|---|
PageElementType.SHAPE | shape | Preset or custom shape, including its text and properties. |
PageElementType.IMAGE | image | Image properties, plus optional placeholder and 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 which slides are visible and in what order;zIndexcontrols drawing order.- Text elements can store plain
textor richer document data throughrichText.rich. - Use
customBlockfor plugin-owned element payloads instead of overloading a deprecated embedded payload.
How is this guide?