Skip to main content

Create swim lane labels upon hovering in Lucidchart

  • February 23, 2026
  • 0 replies
  • 2 views

Micah
Forum|alt.badge.img+20
  • Lucid community team

When creating a diagram with swim lanes, you always add a label to the swim lane header to notate what that particular line is for. However, sometimes lanes become very long, and if the header is out of view in your editor, it’s not easy to remember what lane a particular shape is in. This video shares a great hack using a simple combination of formulas and conditional formatting to create lane labels that appear automatically when hovering over a shape.

 

 

Full transcript here 👇

Create Swim Lane Labels Upon Hovering in Lucidchart

 

Hi, I wanted to show a cool way to make sure that you can always see which swim lane your shape is in in Lucid. As you can see here, when I hover over the center of a shape, it's actually telling me that it is in a specific swim lane. And when I move it, it is smart enough to figure out that it has been moved and that it is in a specific lane.

 

So, how did we do this? Well, I added a conditional formatting rule. I created a rule and made sure that it was applied to every shape, which you can always do by going over here and selecting "apply to all" if you accidentally make it all in one shape. What you can do is set the condition to a formula. Then, you just check that it's contained by any swim lane to activate this. The formula for that is containedBy and then to pass in this modifier for swimLaneLane. We're just checking if it is in a swim lane at all. That is going to give us a list, and then we're going to count that list and just make sure that it's greater than zero, because if something is outside of the swim lane, we don't really care about it. So, on hover, it's not going to show anything in this case.

 

Okay, so that's our condition. Formatting is how we're going to accomplish the other piece. The way to do this is to add an icon. You want it to not be on "shape style," but on "icons." I typically choose the icon library, and then I like to choose one of these dots, because all I'm going to do is make it invisible by giving it no fill color.

 

Once I've done that, I do turn on the custom hover text. This allows me to type whatever I want here. In this case, I've said "in" and then I've used interpolated text. This is similar to something you find in JavaScript and we have it in Lucid as well. It basically allows me to write a formula, like the kind I did here, and have it resolve within the text.

 

The most important thing that I've done here is I've said containedBy and I've passed in again $swimLaneLane. So, that's what's actually figuring out which swim lane this is in. I've passed that in as being a list because it is going to return a list just in case something's in multiple swim lanes. Then, I'm actually joining that list with a modifier. The modifier I'm using to join it is comma space. I then close that out and close my interpolated text.

 

The most important part of the formula is that containedBy($swimLaneLane). If I didn't do anything else, it would show me the list basically of lanes that it's in. That is the reason that I wrap this in a join function, and that becomes my first argument. My second argument is comma space, which I put in quotes because it's a string, and then I close the join. That is how we are getting that list. So it's saying "in half puff" in this case.

 

The final thing I do is the default positioning is the top corner. I like to put it in the center because that just ensures that when I hover over the center of a shape, I will see which swim lane it's in.

 

So, why is that useful? Well, if I've scrolled all the way down and I've got a really large process map here, then when I hover over this, I'm actually going to still see that this is in a specific lane, even though I can't see the top of my swim lane or the lefthand side or the right hand side or however I'm scrolling around. It's a really helpful way to be able to label your shapes and be aware of which lane they're in, even when you can't see the titles of the lanes. Thanks.