Tools
SketchAPI separates portable tool selection from runtime tool control. An app
definition chooses canonical tool ids; the mounted instance exposes discovery,
configuration, and activation through api.tool when the host installs the
tool facade.
Table of Contents
Select a Tool Surface
const definition = {
definitionVersion: '1',
name: 'Drawing editor',
tools: {
defaultTool: 'select',
groups: [{ id: 'draw', tools: ['paintbrush', 'tileBrush', 'shape', 'fancyText'] }]
}
} The default browser adapter loads the tools named by the definition before mounting finishes and applies supported configuration overrides. Group order is the primary toolbar’s exact visible grouping and order; omitted tools stay out of that toolbar. Definitions do not redefine tool implementations or internal metadata.
Runtime Control
const api = await sketchpad.mount(container)
const tools = await api.tool?.list()
const paintbrushSchema = await api.tool?.schema('paintbrush')
await api.tool?.use('paintbrush') Check api.tool because a hosted product may intentionally omit interactive
tool control. Every tool method remains scoped to the mounted Sketchpad
instance and returns a promise.
Product Families
The maintained Sketchpad product includes classic, textured, mirrored, harmony, stamp, spray, streamer, and tile brush families, plus shapes, text, selection, fills, media, crop, guides, zoom, and other workflow tools. A definition exposes only the canonical ids supported by its product build.
Exact inventories and option schemas remain runtime-owned. This page avoids a hand-maintained tool count that would drift from release metadata.
Validation
First-party product adapters can supply canonical catalogs so definition validation rejects unavailable tool ids and unsupported presentation targets before mount. A custom host should use the same catalog it uses to install tools; silently dropping unknown tools produces inconsistent products.
Open Playground to try tools on the live editor, or use the API Reference for exact tool facade signatures.
Ready to build?