existential-birds/beagle / plugins/beagle-react/skills/react-flow-implementation
react-flow-implementation
VerifiedImplements React Flow node-based UIs correctly using @xyflow/react. Use when building flow charts, diagrams, visual editors, or node-based applications with React. Covers nodes, edges, handles, custom components, state management, and viewport control.
| File | Kind | Size |
|---|---|---|
| ADDITIONAL_COMPONENTS.md | markdown | 2.3 KB |
| EDGE_PATHS.md | markdown | 2.4 KB |
| SKILL.md | skill md | 8.1 KB |
ADDITIONAL_COMPONENTS.md
View on GitHub# React Flow Additional Components
## MiniMap
```tsx
import { MiniMap } from '@xyflow/react';
<MiniMap
nodeColor={(node) => {
switch (node.type) {
case 'input': return '#6ede87';
case 'output': return '#ff0072';
default: return '#eee';
}
}}
nodeStrokeWidth={3}
zoomable
pannable
/>
```
## Controls
```tsx
import { Controls } from '@xyflow/react';
<Controls
showZoom={true}
showFitView={true}
showInteractive={true}
position="bottom-left"
/>
```
## Background
```tsx
import { Background, BackgroundVariant } from '@xyflow/react';
// Dots pattern
<Background variant={BackgroundVariant.Dots} gap={16} size={1} />
// Lines pattern
<Background variant={BackgroundVariant.Lines} gap={24} />
// Cross pattern
<Background variant={BackgroundVariant.Cross} />
// Custom color
<Background bgColor="#1a1a1a" color="#444" />
```
## NodeToolbar
```tsx
import { NodeToolbar, Position } from '@xyflow/react';
function CustomNode({ id, selected }: NodeProps) {
return (
<>
<NodeToolbar
isVisible={selected}
position={Position.Top}
>
<button onClick={() => console.log('delete', id)}>Delete</button>
<button>Edit</button>
</NodeToolbar>
<div>Node Content</div>
</>
);
}
```
## NodeResizer
```tsx
import { NodeResizer } from '@xyflow/react';
function ResizableNode({ selected }: NodeProps) {
return (
<>
<NodeResizer
isVisible={selected}
minWidth={100}
minHeight={50}
handleStyle={{ width: 8, height: 8 }}
/>
<div style={{ padding: 10 }}>
Resize me
</div>
</>
);
}
```
## EdgeToolbar (for custom edges)
```tsx
import { EdgeToolbar } from '@xyflow/react';
function CustomEdge({ id, selected, ...props }: EdgeProps) {
const [path, labelX, labelY] = getSmoothStepPath(props);
return (
<>
<BaseEdge path={path} />
<EdgeToolbar x={labelX} y={labelY} isVisible={selected}>
<button>Edit</button>
</EdgeToolbar>
</>
);
}
```
## Panel
```tsx
import { Panel } from '@xyflow/react';
// Positions: top-left, top-center, top-right, bottom-left, bottom-center, bottom-right
<ReactFlow ...>
<Panel position="top-right">
<button onClick={onSave}>Save</button>
<button onClick={onRestore}>Restore</button>
</Panel>
</ReactFlow>
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance 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. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |