Getting Started
Overview
Installation
Theme
Forms
Basic Inputs
Custom Inputs
Select
Components
Components
78
Micro Charts
Navigation
Libraries
Content Editor
Data View
Form Builder
Headless Editor
Image Designer
Kanban Board
PDF Builder
PDF Signer
PDF Viewer
Video Player
GitHub repositoryGitHub starsGitHub forksNgStarter UI npm versionNgStarter UI npm downloads per month

Whiteboard

A canvas workspace for freehand sketches, shapes and diagrams, powered by Konva.js.

Inputs and outputs

NameDescription
value / valueChangemodel<WhiteboardDocument>. Version 1 document with an elements array. Defaults to an empty board. Assigning a new document resets undo/redo.
tool / toolChangemodel<WhiteboardTool>. select, hand, pencil, rectangle, diamond, ellipse, arrow, line, text, note or eraser. Default: pencil.
titlestring. Board title and accessible canvas label. Default: Whiteboard.
subtitlestring. Optional board name below the Whiteboard title.
locale'en' | 'ru'. Language for the built-in controls, menus and dialogs. Default: en.
drawingStyle / drawingStyleChangemodel<WhiteboardStyle>. Stroke, fill, strokeWidth, opacity and lineStyle used for new objects. Text and notes use fontSize, optional fontFamily and optional textAlign. The style also updates on selection.
toolLocked / toolLockedChangemodel<boolean>. Keep the active tool after creating a shape, line, arrow, text or note. Default: true. New objects are always selected. When unlocked, the board switches to Select. Pencil stays active for continuous drawing.
pressureSensitive / pressureSensitiveChangemodel<boolean>. Record pen pressure for variable-width pencil strokes. Mouse and touch keep a uniform width. Default: false.
readonlyboolean. Disables edits, history changes and import; keeps pan, zoom and export available. Default: false.
showToolbarboolean. Shows built-in controls. Default: true.
showGrid / showGridChangemodel<boolean>. Shows the decorative dot grid. Default: true.
showProperties / showPropertiesChangemodel<boolean>. Shows the floating style panel. Default: true.
colorsstring[]. Stroke color presets for ColorSwitcher.
selectionChangereadonly WhiteboardElement[]. Emitted when selected objects change.
viewportChangeWhiteboardViewport { x, y, zoom }. Emitted on pan or zoom.
exportedstring. PNG data URL emitted by exportPng() or the Export button.
importErrorError. Emitted when the file picker cannot read a valid document. importJson() throws validation errors to its caller.

Methods

NameDescription
undo() / redo()Undo or redo one edit; canUndo() and canRedo() expose readonly signals. History keeps up to 100 edits.
clear()Remove all objects in one undoable operation. The built-in menu asks for confirmation.
deleteSelection() / duplicateSelection()Remove or duplicate the current selection in one undoable operation.
zoomIn() / zoomOut() / resetView()Zoom in/out or return to 100% at the origin. Zoom range: 10–500%.
fitToContent()Center the document and fit its bounds in the current viewport.
redraw()Repaint after loading a custom font used by canvas elements. Text objects support fontFamily and textAlign; consuming applications load the font.
exportPng(options?)Returns a PNG data URL, or null before browser initialization. Exports all content without selection controls. Options: pixelRatio (default 2), backgroundColor (default white), padding (default 32).
exportJson()Returns the portable versioned document as JSON, without viewport or undo history.
importJson(json)Validates and loads JSON, resets history and fits the content. Throws on invalid input. No-op in readonly mode.
parseWhiteboardDocument(json)Standalone exported parser for validating saved documents before assigning value.

Theme tokens

NameDescription
--ngs-whiteboard-heightComponent height. Default: 40rem. Also supports normal CSS height on the host.
--ngs-whiteboard-bgCanvas surface. Default: --ngs-color-surface.
--ngs-whiteboard-grid-colorDot grid color. Default: --ngs-color-border.
--ngs-whiteboard-panel-bgFloating controls surface. Default: --ngs-color-surface.
--ngs-whiteboard-panel-shadowFloating controls shadow. Default: --ngs-shadow-sm.