Creating custom component for switch with slider

Hi
I already created a custome switch for my water heater.
The device also has an option to be turned on for a specific period of time.
I thought about using switch with some kind of slider but I’m not sure what exactly I’m looking for here, is it custom UI?
Any assistant will be appreciated.
Thanks!