React Archer is a JavaScript library for drawing dynamic, configurable SVG arrows between any DOM elements within a React application. It is currently at version 4.4.0 and maintains a consistent release cadence, with multiple feature and bugfix releases within recent months, indicating active development. Its primary utility lies in simplifying the visualization of relationships or flows between disparate UI components. Key features include customizable arrow styles (color, width, dash array, curves/angles), support for start/end markers, and the ability to update arrow positions automatically when elements move or resize. It achieves this by managing an SVG layer over your React components, dynamically calculating coordinates based on element anchors. The library supports server-side rendering and provides TypeScript types, making it robust for modern React development.
npm install react-archerVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to set up `ArcherContainer` and `ArcherElement` to draw multiple arrows between React components with custom styling, labels, and anchor points.
Users relying on Flow types must either remain on `react-archer@3.x` or migrate their project to TypeScript.
Ensure target user environments use modern Safari versions. For applications with `#` in URLs, this update resolves previous issues.
Update to `react-archer@4.2.2` or later to leverage bug fixes specifically addressing SSR compatibility and rendering issues.
Update to `react-archer@4.2.0` or later. For situations requiring manual control, access the `refreshScreen` method via the `ArcherContainer` ref, e.g., `archerRef.current?.refreshScreen()`.
Update to `react-archer@4.2.3` or later and use the exported `ArcherContainerRef` type, e.g., `const archerRef = useRef<ArcherContainerRef>(null);`.
Ensure your ref is correctly typed using `ArcherContainerRef` and checked for `null` before use: `const archerRef = useRef<ArcherContainerRef>(null); archerRef.current?.refreshScreen();`
Ensure you are using `react-archer@4.2.2` or newer which includes SSR fixes. If issues persist, consider dynamically importing `react-archer` components only on the client-side or using a conditional rendering approach for SSR.
Verify that all `id` props on `ArcherElement`s are unique and valid strings. Ensure all `ArcherElement`s are descendants of an `ArcherContainer`. Update to `react-archer@4.2.0` or later for fixes related to element registration and refreshing. Check browser console for related errors.