mxyhi/ok-skills / ai-elements
ai-elements
VerifiedBuild AI chat interfaces using ai-elements components — conversations, messages, tool displays, prompt inputs, and more. Use when the user wants to build a chatbot, AI assistant UI, or any AI-powered chat interface.
references/edge.md
View on GitHub# Edge
Customizable edge components for React Flow canvases with animated and temporary states.
The `Edge` component provides two pre-styled edge types for React Flow canvases: `Temporary` for dashed temporary connections and `Animated` for connections with animated indicators.
## Installation
```bash
npx ai-elements@latest add edge
```
## Features
- Two distinct edge types: Temporary and Animated
- Temporary edges use dashed lines with ring color
- Animated edges include a moving circle indicator
- Automatic handle position calculation
- Smart offset calculation based on handle type and position
- Uses Bezier curves for smooth, natural-looking connections
- Fully compatible with React Flow's edge system
- Type-safe implementation with TypeScript
## Edge Types
### `Edge.Temporary`
A dashed edge style for temporary or preview connections. Uses a simple Bezier path with a dashed stroke pattern.
### `Edge.Animated`
A solid edge with an animated circle that moves along the path. The animation repeats indefinitely with a 2-second duration, providing visual feedback for active connections.
## Props
Both edge types accept standard React Flow `EdgeProps`:
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `id` | `string` | - | Unique identifier for the edge. |
| `source` | `string` | - | ID of the source node. |
| `target` | `string` | - | ID of the target node. |
| `sourceX` | `number` | - | X coordinate of the source handle (Temporary only). |
| `sourceY` | `number` | - | Y coordinate of the source handle (Temporary only). |
| `targetX` | `number` | - | X coordinate of the target handle (Temporary only). |
| `targetY` | `number` | - | Y coordinate of the target handle (Temporary only). |
| `sourcePosition` | `Position` | - | Position of the source handle (Left, Right, Top, Bottom). |
| `targetPosition` | `Position` | - | Position of the target handle (Left, Right, Top, Bottom). |
| `markerEnd` | `string` | - | SVG marker ID for the edge end (Animated only). |
| `style` | `React.CSSProperties` | - | Custom styles for the edge (Animated only). |
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: 322k | 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: 198k | 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: 198k | 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: 198k | Updated | Claude CodeCodex | Verified | Install |