Hello, I’d like to build a site based on my design. So far everything is working. One thing I don’t know how to approach is the dashed line connecting the main elements. Is there a way to somehow specify anchor points and have it “flow” dynamically on its own? Any other suggestions on how to do this?
Well, ho-leee farkbunnies. That’s cool.
And the answer is yes.
The basic approach is to use SVG or canvas to draw the lines, but figuring out the calculations for the anchor positions, and how to elegantly curve the line… I don’t have enough beer in my fridge for that level of creativity.
EDIT: Here’s the official documentation site check out those features!
Here’s a quick demo of what I built with it;
You basically ID your elements, and then connect them with a line of script. I like to complicate things though, so my list is CMS sourced, and randomly sorted, So I’m ID’ing them after the page loads.
Here’s the read-only project link to see how I’ve assembled it;
As well as the codepen where I’ve integrated the library.
Wow, that looks perfect. Not sure about influencing the bend and stuff but that’s a thing for later
I’m more of a designer than coder, so do I get this right: I have to host the actual code of the Leader Line somewhere? Like Codepen? And then give the elements in Webflow an ID and point everything to the hosted code?
It’s not much code, and it can all go into your
</body> custom code section of your page. I’m referencing the library from a CDN.
Let’s assume you’ve ID’s the images as;
Then a basic implementation in your code would look something like;