Boards
Folio's boards are freeform pages: a lecture board (a stylus or smart board, bounded pages, recorded with voice) and a whiteboard (an infinite canvas of stickies, shapes, text, connectors, frames and pictures) are the same engine with different defaults. They sit beside documents and decks: the same app shell and design tokens, the same collaboration engine, the same exporters.
The packages
Layered like slides (slides → slides-editor → plugin-slides):
| Layer | Package | What it is |
|---|---|---|
| Ink maths | folio-ink | stroke outlines, simplification, hit-testing, partial erasing, a compact codec |
| Scene | folio-canvas | pages and objects, events with exact inverses, per-user undo, recording, Canvas 2D and SVG rendering, selection maths. DOM-free |
| Browser board | folio-canvas-board | pen, touch, mouse and smart-board input, tools, the live layer, lecture capture. No framework |
| App | folio-plugin-canvas | <BoardApp> for React on folio-react's AppShell, and its pieces |
| Collaboration | folio-canvas-collab | the board binding of Folio's one collaboration engine |
| Export | folio-canvas-export | pages as editable PowerPoint slides and PDF |
| Shared | folio-interaction | snapping, equal spacing, rotated resize, shared with page drawings and slides |
The app
import { FolioStyles } from '@nextgensoftwares/folio-react';
import { BoardApp, whiteboardPlugins } from '@nextgensoftwares/folio-plugin-canvas';
const plugins = whiteboardPlugins(); // or lecturePlugins(), or your pick
<FolioStyles />
<div className="folio-ui" style={{ height: '100vh' }}>
<BoardApp plugins={plugins} title="Course planning" text={textEngine} />
</div><BoardApp> is a whiteboard, not an office editor: the board fills the window under Folio's app bar, the tools float in a dock at the bottom (the current tool's options in a tray above it), a small bar floats over the selection with what it can change, undo and pages sit in one corner and zoom in the other. The controls are Folio's own buttons, menus and colour pickers on Folio's tokens, so a board still reads as part of the same product as documents and decks, light and dark.
Every feature is a plugin, and a board has only the ones you give it (none: a plain board you can select on). Pens, the laser, sticky notes, shapes, text, connectors, pictures, undo, zoom, pages, the Export menu, lecture pages and live collaboration are each one plugin, so a host ships and shows only what it uses. Two bundles give the usual sets:
whiteboardPlugins(): an infinite dotted canvas you start on with the select tool, its paper following the app (dark in the dark theme).lecturePlugins(): bounded pages ruled as a grid, the pen first, a page switcher, and white paper in both themes, as documents and slides have.
import { BoardApp, lecturePlugin, penPlugin, laserPlugin, navigatePlugin, pagesPlugin, historyPlugin } from '@nextgensoftwares/folio-plugin-canvas';
// A lean lecture board: black and red ink, no marker, the laser, undo and pages.
const plugins = [lecturePlugin(), penPlugin({ colors: ['#000000', '#d63031'], marker: false }),
laserPlugin({ group: 'draw' }), navigatePlugin(), historyPlugin(), pagesPlugin()];Customising: plugins take their options (colours, thicknesses, shapes, dock group), and your own plugin can add dock buttons (any icon element), a tray for a tool, selection bar buttons (selectionAction), corner controls and overlays, app bar actions, exporters, and code that runs on the mounted board. arrange has the last word on the dock, the selection bar and the widgets (reorder, drop, add), and slots hides or replaces the app bar, the dock or the selection bar. Every piece is also a public component for your own layout, including the ribbon and inspector of an Office-style shell. See folio-plugin-canvas.
Live collaboration is a plugin too, from its own entry point so boards that don't collaborate don't load it:
import { joinCanvas } from '@nextgensoftwares/folio-canvas-collab';
import { collabPlugin } from '@nextgensoftwares/folio-plugin-canvas/collab';
const collab = await joinCanvas({ server: 'https://collab.example.com', docId: 'lecture-7', user: { name, color } });
const plugins = [...whiteboardPlugins(), collabPlugin(collab)];It edits the shared board, shows everyone's cursors, strokes and laser trails as they draw, and the people here and the save state in the app bar.
Text needs a TextEngine: Folio's font engine measures (bidi, Arabic shaping) and, given fontFamilies and metrics, the board paints in the faces it measured. Without one, stickies and shapes show no text. Double-click a sticky or shape (or press Enter) to type into it; a new sticky opens for typing straight away; the text tool makes free text boxes. Each paragraph takes its own direction, so Arabic and English mix in one note.
Connectors (C) drag from shape to shape and stay attached as the shapes move: dropped near a side centre an end pins there, elsewhere it takes the nearest edge. Drag a selected connector's end to re-attach it.
Without React, createCanvasBoard mounts the board alone.
Input
A stylus draws with pressure; fingers draw until a stylus is seen, then pan and zoom (palms are ignored, and a palm that lands just before the pen is removed). Two fingers always pinch. Smart boards that report every contact as touch use touch: 'draw'; a flat hand can erase (largeContact: 'erase'). Bluetooth smart pens and vendor SDKs feed board.externalPen().
Keys: V select, P pen, M marker, E eraser, H hand, L laser, R shape, N sticky, T text, C connector; Enter types into the selection; Delete, Esc, Ctrl+A, Ctrl+D, Ctrl+B (bold, also while typing), Ctrl+] / Ctrl+[ (with Shift: to front / back), Ctrl+Z / Ctrl+Shift+Z, Ctrl +/−/0, Shift+1 fit; hold Space to pan. Shift keeps aspect while resizing and snaps rotation to 15°; Alt moves without snapping.
Collaboration, recording, export
- Collaboration: pass a shared store to the board (
options.store = createCollabCanvas(...).store). See Collaborating on boards. - Recording:
startLecture(board)records ink, page turns, the presenter's camera and voice on one clock;playLecturereplays strokes as they were written. - Export: the app's Export menu writes the page as SVG and every page as an editable PowerPoint;
exportCanvasPdfwrites a PDF with your fonts.