A whiteboard that a person and an AI draw on together. Notes, shapes, text, frames, pen and connectors on a pan and zoom canvas, with one typed document and one function, applyOps, behind every change, so an AI's edits are marked, grouped and undone as one step.
On this page
- A shared board for a person and an AI
- Planning and brainstorming with sticky notes
- Flow charts and diagrams that stay connected
- A canvas an agent can draw on and a person can undo
Examples
Driven from code
On a phone
Your own object kinds
Every sort of object is a kind: its type, how it starts, how it is drawn, exported and described to a model, and the tool that makes it. The board is built from a list of kinds, so a new one is one module and one entry in the list, with no change to the board. A checklist is the example: it installs as its own item, and an AI run creates one with a plain add op.
Installation is part of Pro
Pro components install from a licensed registry. The live preview stays open to everyone.
What a kind is
The pure half (KindSpec) has no screen and is what applyOps, the export, boardToContext and the AI read: create, svg, context, an optional hit area, textField, resize and how the AI cursor works with it. The canvas half (BoardKind) adds render, tools, actions for the selection bar and drop for files. A type the board has no kind for is kept in the document and drawn as a labelled box, so a saved board never loses an object.
// One line adds the type to the document type. No core file is edited.
declare module "../whiteboard-model" {
interface BoardObjectMap { checklist: Checklist }
}
export const checklistKind: BoardKind<Checklist> = {
...checklistSpec, // create, svg, context, ai: the pure half
label: "Checklist",
render: ChecklistView, // a component: it gets the object, its box, patch() and done()
editable: true,
tools: [{ id: "checklist", label: "Checklist", key: "l", mode: "box", edit: true, icon: <path d="..." /> }],
};
<Whiteboard doc={doc} onChange={setDoc} kinds={[...builtinKinds, checklistKind]} />Installation
Installation is part of Pro
Pro components install from a licensed registry. The live preview stays open to everyone.
Props
- doc
BoardDoc- The board: { objects: BoardObject[] }. The array order is the z order, first at the back.
- onChange
(doc, meta) => void- Every change, with meta { author, group, ops, inverse, touched }. Store the new doc. Ops with the same group undo as one step.
- viewport / onViewportChange
{ x, y, k }- Default
uncontrolled - The pan and zoom, when you want to own it (for a minimap elsewhere or to follow an AI cursor).
- onSelectionChange
(ids: string[]) => void- The selected ids, whenever they change.
- renderOverlay
({ viewport, toScreen, size }) => ReactNode- Drawn above the objects in the same space, never takes the pointer. For cursors, comments or highlights.
- kinds
BoardKind[]- Default
builtinKinds - The kinds of object the board knows, with their tools. `[...builtinKinds, mathKind]` draws formulas too; add your own the same way. Objects of a type not in the list are kept and shown as a labelled box.
- toolbar
{ before?, after? }- Extra content in the tool dock, before or after the kind tools.
- onImageFile
(file: File) => Promise<string>- Turns a dropped image into a src (a URL or data URL). Without it, drops do nothing.
- readOnly
boolean- Default
false - Look, pan and zoom only.
- ref
WhiteboardHandle- apply(ops, { author, groupId }), undo(), redo(), undoGroup(group), fit(), exportPng(), exportSvg().
- Objects
note|shape|text|pen|image|frame|connector- Every object has id, x, y, author and ai; sized ones add w and h. A frame child has frameId and a position relative to the frame. A connector end is { id, side? } to stay stuck, or { x, y } to float.
- Ops
add|update|remove|move|reorder|reparent- applyOps(doc, ops, { author, groupId }) is pure: it returns the new doc, what was applied, the exact inverse, any rejected op and the touched ids. Locked objects refuse edits.
| Prop | Type | Default | Description |
|---|---|---|---|
| doc | BoardDoc | - | The board: { objects: BoardObject[] }. The array order is the z order, first at the back. |
| onChange | (doc, meta) => void | - | Every change, with meta { author, group, ops, inverse, touched }. Store the new doc. Ops with the same group undo as one step. |
| viewport / onViewportChange | { x, y, k } | uncontrolled | The pan and zoom, when you want to own it (for a minimap elsewhere or to follow an AI cursor). |
| onSelectionChange | (ids: string[]) => void | - | The selected ids, whenever they change. |
| renderOverlay | ({ viewport, toScreen, size }) => ReactNode | - | Drawn above the objects in the same space, never takes the pointer. For cursors, comments or highlights. |
| kinds | BoardKind[] | builtinKinds | The kinds of object the board knows, with their tools. `[...builtinKinds, mathKind]` draws formulas too; add your own the same way. Objects of a type not in the list are kept and shown as a labelled box. |
| toolbar | { before?, after? } | - | Extra content in the tool dock, before or after the kind tools. |
| onImageFile | (file: File) => Promise<string> | - | Turns a dropped image into a src (a URL or data URL). Without it, drops do nothing. |
| readOnly | boolean | false | Look, pan and zoom only. |
| ref | WhiteboardHandle | - | apply(ops, { author, groupId }), undo(), redo(), undoGroup(group), fit(), exportPng(), exportSvg(). |
| Objects | note | shape | text | pen | image | frame | connector | - | Every object has id, x, y, author and ai; sized ones add w and h. A frame child has frameId and a position relative to the frame. A connector end is { id, side? } to stay stuck, or { x, y } to float. |
| Ops | add | update | remove | move | reorder | reparent | - | applyOps(doc, ops, { author, groupId }) is pure: it returns the new doc, what was applied, the exact inverse, any rejected op and the touched ids. Locked objects refuse edits. |
Keyboard
Vselect,Hhand,Nnote,Rrectangle,Oellipse,Ddiamond,Ttext,Fframe,Cconnector,Ppen. A kind you add brings its own key (the checklist isL).Deleteremoves,⌘Dduplicates,⌘Cand⌘Vcopy and paste,⌘Aselects all,⌘Zand⇧⌘Zundo and redo.- Arrow keys nudge by 1, with Shift by 10.
[and]move one step back or forward, with ⌘ to the very back or front.0fits the board.Enteredits the selected object. - The Hand tool pans on any drag, even over objects, and selects or moves nothing; one finger pans on touch. Hold
Spacefor a temporary hand that lets go back to the previous tool, or drag with the middle mouse button in any tool.Ctrlor⌘with the wheel zooms about the pointer.
Accessibility
- The canvas is a labelled application region you can focus, and every tool and bar button has a name. Tools show their key in a tooltip.
- Tools, bars and the minimap are real buttons you reach with Tab. On the canvas you can nudge a selection with the arrows, edit it with Enter, delete, duplicate and undo from the keyboard; drawing and resizing need a pointer.
- The AI mark has a text name, "Made by AI", and is not colour alone.
- On a touch screen the controls are 40px or larger, the connect dots are always visible, and the selection bar docks above the tools.
What it handles
- 01Draws sticky notes in six colours, rectangles, ellipses and diamonds, text, frames, freehand pen strokes and images the host supplies, on a pan and zoom canvas.
- 02Keeps connectors stuck to their shapes: move a shape and the line re-routes. Drag from a dot on a selected shape to connect it, or use the connector tool.
- 03Selects with a click, shift click and a marquee; moves, resizes from eight handles and nudges with the arrow keys. Align, spread, bring to front, send to back, duplicate, copy and paste.
- 04Groups a frame's contents: drop a note in a frame and it belongs to it, move the frame and its notes go along.
- 05Carries every change through one function, `applyOps`, with an author on each object. Objects an AI made wear a small mark until a person edits or keeps them.
- 06Undoes in groups. A drag, a typing session or a whole AI run is one step, and `undoGroup` takes back one run even after the person edited something else.
States
- Drag, resize, pan, zoom
- Follow the pointer
- none
- Hover a tool or a bar button
- Colour changes
- 120ms, ease out
- Connect dots on a selected shape
- Fade in on hover (always shown on touch)
- 120ms, ease out
- Drop target frame
- Its ring lights while a note is over it
- 120ms, ease out
- Reduced motion
- Every change lands at once
- 0ms
| State | What moves | Timing |
|---|---|---|
| Drag, resize, pan, zoom | Follow the pointer | none |
| Hover a tool or a bar button | Colour changes | 120ms, ease out |
| Connect dots on a selected shape | Fade in on hover (always shown on touch) | 120ms, ease out |
| Drop target frame | Its ring lights while a note is over it | 120ms, ease out |
| Reduced motion | Every change lands at once | 0ms |
Works with
When to use
When to use
- A shared board where a person and an AI work on the same notes, shapes and diagrams.
- Brainstorming, planning and flow charts where an agent adds to the board and the person can undo the whole run.
When not to use
- A graph of typed nodes that runs a pipeline: use Node Graph Editor.
- A workflow with steps and branches: use Workflow Builder.
Using with AI
Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:
- Add the Knowns UI AI Whiteboard to my app and wire it to my own data.
- I need a shared board where a person and an AI work on the same notes, shapes and diagrams. Set that up with the Knowns UI AI Whiteboard.
- Which AI Whiteboard props do I need for a minimal setup? Show me a short example.
With the server connected, your assistant calls get_component({ name: "ai-whiteboard" }) and search_docs({ query: "ai whiteboard" }). Pro props, full examples and source come back once your license key is in the MCP config.