@openprojectx/flow-builder
v0.1.2
Published
Portable, configurable visual node-builder canvas: palette, schema-driven forms, typed connections, serialization
Readme
@openprojectx/flow-builder
The visual node-builder canvas of flowkit — palette, typed connections,
schema-driven property forms, group nodes, sticky notes, MiniMap, dirty
tracking and serialization, driven by a single FlowBuilderConfig.
Minimal example
import { FlowBuilderProvider, FlowBuilderCanvas } from '@openprojectx/flow-builder'
import '@openprojectx/flow-builder/styles.css'
const config = {
registry: { list: async () => myNodeSchemas },
onSave: (doc) => saveSomewhere(JSON.stringify(doc))
}
<FlowBuilderProvider config={config}>
<FlowBuilderCanvas />
</FlowBuilderProvider>Requires reactflow v11 and the MUI theme (best with
@openprojectx/ui-foundation's FlowkitThemeProvider).
Key concepts
- NodeRegistryAdapter — where palette nodes come from. Implement
list(), optionallyrenderIcon()andcategories(). - Handle-id type signatures — handles are named
nodeId-input|output-name-TypeA|TypeB, so connection rules work without a registry lookup. ComposetypesIntersect/respectsListAnchors/noSelfNoCycles, or just usetypedPortsIsValidConnection. - Schema-driven forms —
SchemaFieldsmapsinputParam.typeto a field renderer. 20 types built in; override per type or per"node:param"viaconfig.fieldRenderers. - Conditional visibility — params declare
show/hidemaps over sibling values (with regex, array,$indexsupport) — same engine as Flowise. - The
{{ref}}convention — if youronConnectInputwrites reference strings like{{nodeId.data.instance}}into inputs, the provider's default disconnect logic scrubs them on delete; override withrefScrubber.
See the repo root README for the full config reference, and
examples/playground for two complete builders (data-pipeline + BPMN) built
on this package.
