Univer Boards API
Learn how to use Facade API in a Univer Boards application.
Facade API provides an application-facing layer over Univer services and unit models. Use it for common Board operations such as creating boards, reading active pages, adding elements, updating containers, and managing swimlanes.
Caution
Board mutations are synchronous and return boolean or a nullable handle. Check the return value before reading the result.
Enable the facade entry
Boards is distributed as Web SDK plugins. Import the facade entry for the Board capability used by your application:
import { FUniver } from '@univerjs/core/facade'import '@univerjs-pro/boards/facade'Create the API object after the Univer instance and required plugins are registered:
const univerAPI = FUniver.newAPI(univer)Create and read a board
Use createBoard to create a Board unit through the facade layer. In lower-level setup code, create the unit with univer.createUnit(UniverInstanceType.UNIVER_BOARD, snapshot).
const board = univerAPI.createBoard({ id: 'board-demo', name: 'Board Demo',})const activeBoard = univerAPI.getActiveBoard()const sameBoard = univerAPI.getBoard(board.getId())Continue with core features
The returned FBoard object is the entry point for the active page and its content. Continue with the focused guides for detailed operations:
- Elements covers reading, inserting, connecting, transforming, arranging, and removing Board elements.
- Containers & Swimlanes covers framed groups, membership, and swimlane structure.
Reference
How is this guide?