Is there a way to reference the next/previous component attributes from a component?

So, I have a component that I wish to link to a sibling component. Is there a way to do this? I want to draw a line from one component to it’s next sibling. Also, if this is possible, how do I force which sibling is next and don’t draw a line if there is no next sibling.