GitHub Copilot ChatGPT Claude Codex CLI Cursor opencode Skill Text

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.

Ciza · 0 points · 24 views 0 listing impressions 0 install-command copies
Virus-scanned Reviewed automatically before listing.

Full trust report

Download microsoft-skills-.github_plugins_azure-sdk-typescript_skills_react-flow-node-ts-e58528d.zip · 2 KB
Part of microsoft/skills — 195 skills

Install

skills CLI npx skills add https://github.com/microsoft/skills/tree/main/.github/plugins/azure-sdk-typescript/skills/react-flow-node-ts
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install microsoft-skills@llmmart
Git git clone https://github.com/microsoft/skills.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole microsoft/skills collection as a plugin from our marketplace. Git is the plain clone.

Skill manifest

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

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

  1. Add type to src/frontend/src/types/index.ts
  2. Create component in src/frontend/src/components/nodes/
  3. Export from src/frontend/src/components/nodes/index.ts
  4. Add defaults in src/frontend/src/store/app-store.ts
  5. Register in canvas nodeTypes
  6. Add to AddBlockMenu and ConnectMenu
Files (skills)
  • assets
    • template.tsx 3.2 KB · in bundle
    • types.template.ts 853 B
      import { Node } from '@xyflow/react';
      
      /**
       * {{NodeData}} - Data structure for {{NodeName}}
       * 
       * Extends Record<string, unknown> for React Flow compatibility.
       */
      export interface {{NodeData}} extends Record<string, unknown> {
        /** Display title for the node */
        title: string;
        
        /** Optional description */
        description?: string;
        
        // Add additional properties specific to this node type
      }
      
      /**
       * {{NodeName}} type alias for React Flow
       * 
       * Usage:
       * ```typescript
       * const node: {{NodeName}} = {
       *   id: 'unique-id',
       *   type: '{{nodeType}}',
       *   position: { x: 0, y: 0 },
       *   data: { title: 'Example' },
       * };
       * ```
       */
      export type {{NodeName}} = Node<{{NodeData}}, '{{nodeType}}'>;
      
      // Remember to add {{NodeName}} to the AppNode union type in types/index.ts:
      // export type AppNode = VideoNode | ImageNode | ... | {{NodeName}};
      
  • SKILL.md 2 KB
    ---
    name: react-flow-node-ts
    description: 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.
    license: MIT
    metadata:
      author: Microsoft
      version: "1.0.0"
    ---
    
    # React Flow Node
    
    Create React Flow node components following established patterns with proper TypeScript types and store integration.
    
    ## Quick Start
    
    Copy templates from [assets/](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](assets/template.tsx) - Node component
    - [assets/types.template.ts](assets/types.template.ts) - TypeScript definitions
    
    ## Node Component Pattern
    
    ```tsx
    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
    
    ```typescript
    export interface MyNodeData extends Record<string, unknown> {
      title: string;
      description?: string;
    }
    
    export type MyNode = Node<MyNodeData, 'my-node'>;
    ```
    
    ## Integration Steps
    
    1. Add type to `src/frontend/src/types/index.ts`
    2. Create component in `src/frontend/src/components/nodes/`
    3. Export from `src/frontend/src/components/nodes/index.ts`
    4. Add defaults in `src/frontend/src/store/app-store.ts`
    5. Register in canvas `nodeTypes`
    6. Add to AddBlockMenu and ConnectMenu
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.

Related