Make elements in components scale in percentage when resizing?

I’m trying to make a slider component but the component has a certain width (see image). When I paste an instance of the component and I need to resize it, I’d like the blue fill-line and the blue handle button scale with the resizing in percentage. I can only set it to left, right, center or scale but not in percentage.

Is there a way to make this work?