mcpbeat

React Flow Node Ts

microsoft/react-flow-node-ts

Create React Flow node components with TypeScript types, handles, and Zustand integration. Use when building custom nodes for React Flow canvas, creating visual workflow editors, or implementing node-based UI components.

2k tokens
context cost
the whole folder, loaded on every use
3
files
ships runnable scripts
0
copies elsewhere
how many repositories repackaged it
105 d ago
last touched
this folder, not the whole repository

Install

one command, takes just this skill from the repository
npx skills add https://github.com/microsoft/skills --skill react-flow-node-ts

What comes with it

4 106 bytes besides the instruction
assets/template.tsx
assets/types.template.ts

The instruction itself

6 sections, as written by the author

React Flow Node

Create React Flow node components following established patterns with proper TypeScript types and store integration.

Quick Start

Copy templates from assets/ and replace placeholders:

  • {{NodeName}} → PascalCase component name (e.g., VideoNode)
  • {{nodeType}} → kebab-case type identifier (e.g., video-node)
  • {{NodeData}} → Data interface name (e.g., VideoNodeData)

Templates

  • assets/template.tsx - Node component
  • assets/types.template.ts - TypeScript definitions

Node Component Pattern

export const MyNode = memo(function MyNode({
  id,
  data,
  selected,
  width,
  height,
}: MyNodeProps) {
  const updateNode = useAppStore((state) => state.updateNode);
  const canvasMode = useAppStore((state) => state.canvasMode);
  
  return (
    <>
      <NodeResizer isVisible={selected && canvasMode === 'editing'} />
      <div className="node-container">
        <Handle type="target" position={Position.Top} />
        {/* Node content */}
        <Handle type="source" position={Position.Bottom} />
      </div>
    </>
  );
});

Type Definition Pattern

export interface MyNodeData extends Record<string, unknown> {
  title: string;
  description?: string;
}

export type MyNode = Node<MyNodeData, 'my-node'>;

Integration Steps

  • Add type to src/frontend/src/types/index.ts
  • Create component in src/frontend/src/components/nodes/
  • Export from src/frontend/src/components/nodes/index.ts
  • Add defaults in src/frontend/src/store/app-store.ts
  • Register in canvas nodeTypes
  • Add to AddBlockMenu and ConnectMenu

How to use it

Copy the folder

Take microsoft/react-flow-node-ts from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.