how can i change the width dynamically

so the problem is i dont know how to implement dynamic width change to a component how can i achieve that?

You just update it:

label.width = 123