react-flow
Installation
SKILL.md
React Flow (@xyflow/react)
Implement interactive node-based graphs and workflow editors using @xyflow/react (v12 and v13, React 18/19).
Implementation Gates
Run these checks in order before treating any integration as complete:
- CSS & container dimensions — Import
@xyflow/react/style.css(v13, wrapped in@layer xyflowfor Tailwind v4 precedence) or@xyflow/react/dist/style.css(v12), and give the wrapper element explicit dimensions (widthandheight). - Stable
nodeTypes/edgeTypes— DefinenodeTypesandedgeTypesat module scope or memoize withuseMemo; never create inline object literals on every render (causes full node/edge remounting). - Provider boundary — Any component calling
useReactFlow(),useNodesData(),useNodeConnections(), or store hooks must be a descendant of<ReactFlowProvider>(or rendered inside<ReactFlow />). - Measured vs SSR dimensions — Read DOM-measured node sizes from
node.measured?.width/node.measured?.height(falling back tonode.width ?? defaultWidth). For SSR/SSG, provide staticwidth/heightorinitialWidth/initialHeighton nodes sofitViewand initial layout work without DOM measurement.