
react-flow
Expert guidance for React Flow (@xyflow/react): building interactive node-based graphs, custom nodes and edges, handles, state management, layouting, TypeScript patterns, performance optimization, accessibility, SSR, and theming. Use when writing React Flow code, creating custom nodes or edges, debugging flow issues, optimizing graph performance, integrating with Zustand, or building canvas-based UIs with React Flow.
- Installs
- 825
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/framara/react-flow-skill --skill react-flow- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads react-flow automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
React Flow
Overview
Use this skill to build, customize, debug, and optimize interactive node-based UIs with React Flow (@xyflow/react v12+). Covers everything from basic setup to advanced patterns like computed flows, sub-flows, and external layout integration.
Version and source policy
Guidance reviewed against @xyflow/react 12.12.0 on 2026-09-28. Check the target project's installed version and lockfile before applying an API; “v12+” does not mean every minor release has every feature. Preserve the project's state and styling choices unless the task requires changing them.
Use the official documentation index to find a specific guide or API page. For version-sensitive behavior, check release notes and the installed package's declarations/source. Read only the references relevant to the task. Examples with omitted imports or ... are integration sketches, not standalone applications.
Agent behavior contract (follow these rules)
- For v12 projects, import from
@xyflow/react. If maintaining a legacy project, follow its installed API until a migration is in scope. - Always import the stylesheet:
import '@xyflow/react/dist/style.css'(orbase.csswhen replacing the default visual styles). - The
<ReactFlow>parent container must resolve to nonzero width and height (explicit sizing or a sized flex/grid layout). - Define
nodeTypesandedgeTypesobjects outside component bodies or wrap inuseMemoto prevent re-renders. - Use custom nodes for application-specific content or handles; built-in nodes remain suitable for simple labeled graphs.
- Use the
nodragclass on interactive elements inside custom nodes (inputs, buttons, selects). - Use
nowheelclass on scrollable elements inside custom nodes to prevent zoom interference. - When hiding handles, use
visibility: hiddenoropacity: 0— neverdisplay: none(breaks dimension calculation). - When using multiple handles of the same type on a node, always assign unique
idprops. - After adding, removing, or repositioning handles, call
useUpdateNodeInternalsafter the DOM update, such as in an effect. - Always create new objects when updating node/edge state — mutations are not detected by React Flow.
- Prefer controlled flows for non-trivial applications. Wire
onNodesChangeandonEdgesChangefor editable controlled elements, and addonConnectonly when users can create connections.
First 60 seconds (triage template)
- Identify the goal from the request: new flow setup, custom nodes/edges, state management, layout, performance, styling, E2E testing, advanced patterns (undo/redo, copy/paste, computed flows, collaboration), or debugging.
- Inspect the project for these facts; ask only when a missing fact affects the solution:
- React Flow version (v12+ uses
@xyflow/react) - TypeScript or JavaScript
- State management approach (local state, Zustand, Redux)
- Number of nodes expected (affects performance strategy)
- Styling approach (CSS, Tailwind, styled-components)
- React Flow version (v12+ uses
- Branch quickly:
- migrating from legacy
reactfloworreact-flow-renderer-> package rename, import changes, API differences - blank canvas or missing nodes -> container dimensions or missing CSS import
- edges not rendering -> missing handles, missing CSS, or
display: noneon handles - re-renders or sluggish performance -> nodeTypes defined inside component, missing memoization
- connecting nodes not working -> missing
onConnecthandler or handle configuration - layout/positioning -> external layout library integration (dagre, elkjs)
- type errors -> TypeScript generic patterns for Node/Edge types
- migrating from legacy
Routing map (read the right reference fast)
- Migrating from
reactfloworreact-flow-rendererto@xyflow/reactv12 ->references/migration.md - Installation, setup, first flow, node/edge objects ->
references/fundamentals.md - Custom node components, Handle, multiple handles, drag handles ->
references/custom-nodes.md - Custom edge components, path utilities, edge labels, markers ->
references/custom-edges.md - Event handlers, callbacks, connection validation, selection, keyboard ->
references/interactivity.md - Controlled vs uncontrolled, Zustand integration, state update patterns ->
references/state-management.md - Node/Edge types, generics, union types, type guards ->
references/typescript.md - External layout libraries (dagre, elkjs, d3), sub-flows, parent-child ->
references/layouting.md - Background, Controls, MiniMap, Panel, NodeToolbar, NodeResizer, hooks ->
references/components-and-hooks.md - Memoization, render optimization, theming, CSS variables, Tailwind ->
references/performance-and-styling.md - Keyboard workflows, accessible names, focus management, assistive technology ->
references/accessibility.md - Server rendering, initial geometry, hydration, Next.js boundaries ->
references/ssr-and-hydration.md - Common errors, debugging, edge display issues, Zustand warnings ->
references/troubleshooting.md - Playwright E2E tests, flow selectors, drag/viewport/connection testing ->
references/e2e-testing.md - Undo/redo, copy/paste, computed flows, dynamic handles, save/restore, collaboration ->
references/advanced-patterns.md - Context menu add node, drag-and-drop sidebar, detail panel, export as image ->
references/recipes.md
Common pitfalls -> next best move
- Blank canvas with no errors -> parent container has no height; set explicit
height: 100vhor equivalent. nodeTypes/edgeTypeswarning -> move object definition outside component body or wrap inuseMemo.- Edges render but in wrong position -> handles use
display: none; switch toopacity: 0. - Cannot interact with inputs inside nodes -> add
className="nodrag"to interactive elements. - Nodes snap back after drag ->
onNodesChangenot wired up or not applying changes correctly. - Connection line appears but edge never creates ->
onConnecthandler missing or not callingaddEdge. - Multiple handles on same side overlap -> position them with CSS (
topoffset) and assign uniqueids. - State updates don't reflect in nodes -> creating mutations instead of new objects; spread operator required.
- Zustand context warning -> two versions of
@xyflow/reactinstalled or missing<ReactFlowProvider>. - Sub-flow children mispositioned with "Parent node not found" warning -> ensure parent nodes appear before children in the
nodesarray.
Verification checklist
- Confirm
@xyflow/react/dist/style.cssis imported (orbase.css+ custom styles). - Confirm the parent container resolves to nonzero width and height.
- Confirm
nodeTypes/edgeTypesare stable references (defined outside component or memoized). - Confirm custom nodes that need connections use
<Handle>components with propertype,position, and IDs. - Confirm interactive elements inside nodes have
nodragclass. - Confirm controlled flows wire
onNodesChange/onEdgesChangefor editable elements andonConnectwhen connection creation is enabled. - Confirm state updates create new node/edge objects (no mutations).
- Confirm TypeScript generics are applied to hooks and callbacks for type safety.
- Confirm performance-sensitive flows memoize custom node/edge components with
React.memo.
For changed examples, type-check complete snippets and exercise the affected interaction in a real browser. Compilation alone does not verify handles, edge geometry, dragging, or viewport visibility.
References
references/migration.mdreferences/fundamentals.mdreferences/custom-nodes.mdreferences/custom-edges.mdreferences/interactivity.mdreferences/state-management.mdreferences/typescript.mdreferences/layouting.mdreferences/components-and-hooks.mdreferences/performance-and-styling.mdreferences/troubleshooting.mdreferences/e2e-testing.mdreferences/advanced-patterns.mdreferences/recipes.mdreferences/accessibility.mdreferences/ssr-and-hydration.md
FAQ
What does the react-flow skill do?
Expert guidance for React Flow (@xyflow/react): building interactive node-based graphs, custom nodes and edges, handles, state management, layouting, TypeScript patterns, performance optimization, accessibility, SSR, and theming. Use when writing React Flow code, creating custom nodes or edges, debugging flow issues, optimizing graph performance, integrating with Zustand, or building canvas-based UIs with React Flow.
How do I install react-flow?
Run npx skills add https://github.com/framara/react-flow-skill --skill react-flow in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/react-flow/ (personal) or .claude/skills/react-flow/ (project).
Which AI agents can use react-flow?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is react-flow safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains react-flow?
It is published by framara in framara/react-flow-skill. It has 825 recorded installs.
Popular frontend & design skills
setup-matt-pocock-skills
mattpocock/skills
Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.
frontend-design
anthropics/skills
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.
hyperframes-animation
heygen-com/hyperframes
All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.
prototype
mattpocock/skills
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
hyperframes-core
heygen-com/hyperframes
The HyperFrames composition contract — build one renderable project. Use for composition structure, the data- timing attributes, class="clip", tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.
vercel-react-best-practices
vercel-labs/agent-skills
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.