The complete reference for wiring an app to flowkit: FlowBuilderConfig, feature
flags, slots, theming, and the useFlowBuilder context API. Types from
packages/flow-builder/src/types.ts.
import { FlowBuilderProvider, FlowBuilderCanvas } from '@openprojectx/flow-builder'
import { FlowkitThemeProvider } from '@openprojectx/ui-foundation'
import '@openprojectx/flow-builder/styles.css'
<FlowkitThemeProvider>
<FlowBuilderProvider config={config}>
<FlowBuilderCanvas />
</FlowBuilderProvider>
</FlowkitThemeProvider>| Field | Type | Description |
|---|---|---|
|
|
Palette node source. |
|
|
Extra palette filter (category blacklists, feature gating). Composes with |
| Field | Type | Description |
|---|---|---|
|
|
Merged over the 20 kit defaults. Key by param |
|
|
Backs the |
FieldRendererProps:
interface FieldRendererProps {
inputParam: InputParam
data: BuilderNodeData
value: unknown // data.inputs[inputParam.name]
onChange: (newValue: unknown) => void
disabled?: boolean
arrayIndex?: number // set inside `array` items
parentParam?: InputParam // the parent `array` param
}| Field | Type | Description |
|---|---|---|
|
|
Extra/override React Flow node types (key = the |
|
|
Extra/override edge types. |
|
|
Map a dropped schema to a node type. Default: |
|
string |
Type for new edges. Default |
|
|
Card tint + edge gradient source. Default: |
|
|
Extra content under the node label (Flowise’s model/tool chips). |
|
|
Shows an Info button in the node toolbar. |
|
|
Warning badge text (outdated version, deprecation). |
|
|
Hide Duplicate in the toolbar (default true). |
| Field | Type | Description |
|---|---|---|
|
|
Gate for new edges. Default: no self-connections + no cycles ( |
|
|
Post-connect side effect — e.g. write |
|
|
Replace the default |
|
|
Color of the in-progress connection line. |
|
|
Label on the in-progress connection line. |
|
|
Label stored on the new edge (rendered mid-line). |
|
|
Reject a palette drop with a user-facing message (singleton rules, group-membership rules). |
Connection rule helpers exported for composition: typesIntersect,
respectsListAnchors, wouldCreateCycle, noSelfNoCycles,
defaultIsValidConnection, typedPortsIsValidConnection.
| Field | Type | Description |
|---|---|---|
|
|
Param-vs-anchor split for raw schema inputs. Default: whitelist of 20 form types ( |
|
|
Output anchor strategy. |
| Field | Type | Description |
|---|---|---|
|
|
Document loaded on mount (alternative: call |
|
|
Default: React Flow |
|
|
Inverse of |
|
|
Called by |
|
|
Fires on dirty transitions — bridge to your store (Flowise mirrors into Redux |
| Field | Type | Description |
|---|---|---|
|
|
How params are edited. Default |
|
|
Side effects after an |
All default to enabled unless noted:
features?: {
minimap?: boolean // MiniMap bottom-right
stickyNote?: boolean // sticky-note schemas in palette
groupNodes?: boolean // group nodes + drop-into parenting
snapping?: boolean // snap-grid toggle in Controls
backgroundDots?: boolean // background toggle in Controls
palette?: boolean // show the add-node FAB (default true)
readOnly?: boolean // no add/edit/delete (default false)
minZoom?: number // default 0.5
}Available anywhere under FlowBuilderProvider:
const {
reactFlowInstance, // the React Flow instance (captured onInit)
nodes, edges, // imperative snapshots
isDirty, setDirty, // dirty flag (setDirty() → true, setDirty(false) clears)
deleteNode, deleteEdge, // graph mutations (with child cascade + ref scrubbing)
duplicateNode,
onNodeDataChange, // { nodeId, inputParam, newValue } → visibility recompute
setNodeStatus, // { nodeId, status, error? } badge control
clearNodeStatuses,
dialogOpen, setDialogOpen, // Delete-key suspension
editNode, setEditNode, // inspector target
saveFlow, // serialize + onSave + clear dirty → FlowDocument
loadFlow, // replace canvas contents (import/paste) → marks dirty
config
} = useFlowBuilder()|
Note
|
FlowBuilderProvider wraps reactflow’s `ReactFlowProvider — useStore,
useReactFlow, useUpdateNodeInternals etc. work in any child component.
|
import { FlowkitThemeProvider, useThemeMode, createFlowkitTheme } from '@openprojectx/ui-foundation'
// uncontrolled — persists to localStorage['isDarkMode']
<FlowkitThemeProvider>{children}</FlowkitThemeProvider>
// controlled — host owns the mode (e.g. Flowise's Redux)
<FlowkitThemeProvider mode={isDarkMode ? 'dark' : 'light'} onModeChange={...}>
{children}
</FlowkitThemeProvider>-
createFlowkitTheme({ mode, fontFamily?, borderRadius? })— the raw MUI theme factory (palette incl.card,orange,teal,canvasHeader,codeEditor,nodeToolTip; typography incl.commonAvatar,smallAvatar…). -
Kit components read dark mode via
theme.palette.mode— any MUI theme with a propermodeworks, but the full Flowise look needs the factory’s custom keys.
const config: FlowBuilderConfig = {
registry: { list: fetchOperators, renderIcon: (n) => <OperatorIcon name={n.name} /> },
isValidConnection: typedPortsIsValidConnection, // typed ports
outputStrategy: 'standard', // type-signed output handles
onConnectInput: (targetData, param, sourceId) => { // record the link in inputs
targetData.inputs[param.name] = `{{${sourceId}.data.instance}}`
},
validateDrop: (schema, { nodes }) =>
schema.name === 'source' && nodes.some((n) => n.data.name === 'source')
? 'Only one source allowed'
: undefined,
onSave: (doc) => api.saveFlow(flowId, JSON.stringify(doc)),
onDirtyChange: (dirty) => store.setUnsaved(dirty),
features: { minimap: true, stickyNote: false },
slots: { header: <StudioHeader /> }
}