@synergycodes/overflow-ui
Version:
A React library for creating node-based UIs and diagram-driven applications. Perfect for React Flow users, providing ready-to-use node templates and components that work seamlessly with React Flow's ecosystem.
25 lines (24 loc) • 831 B
TypeScript
import { EdgeState } from '../types';
type UseEdgeStyleParams = {
/**
* The visual state of the edge. Determines base styles like `strokeWidth`.
*/
state?: EdgeState;
/**
* Whether the edge is currently hovered.
* When true, applies hover color on top of the state styles.
*/
isHovered?: boolean;
};
/**
* A custom hook for computing CSS style properties for diagram edges based on their visual state and hover interaction.
*
* The `useEdgeStyle` hook returns an object of CSS properties (such as `stroke`, `strokeWidth`, and `transition`)
* that can be directly applied to an SVG path element representing an edge.
*/
export declare function useEdgeStyle({ state, isHovered, }: UseEdgeStyleParams): {
stroke: string;
strokeWidth: string;
transition: string;
};
export {};