Set slider value based on mouse location

Sorry should have clarified, that is a slider. I’m creating a material to mimic a progress bar.

What I’m after is for the bar to set what the cursor is clicking on like if I were to click on an area like below it just goes to that value