How do I draw line on remaining horizontal space

I’m trying to add a horizontal line to fill the space similar to h(1fr). However, it seems I cannot specify a relative length to line. Ultimately, I’m trying to achieve something similar to this.

I still need to use explicit line lengths here. Is there a way to compute them automatically?

Welcome to the forum,

Would you please share the code you are trying with us please in order to speed up the process?

A minimum working example (MWE) that compiles and shows what issue you are encountering will do wonders here, and usually fast.

1 Like

You can use a box around the line to set a fractional length.

#box(width: 1fr, line(length: 100%))
2 Likes

Also have a look at repeat Repeat Function – Typst Documentation :

+ #lorem(2) #box(width: 1fr, repeat(".")) True False
1 Like

Thanks, a box with a fractional width is what I’m looking for.

I tried to create an MWE, but I already had two approaches: one with grid and another with only h. I wasn’t sure if using either would muddle the discussion, when it feels like I just missed some components/functions.