In this article, you can learn how to make an input text like as a material design does.

https://medium.com/sketch-app-sources/create-an-adaptive-sketch-symbol-for-material-designs-outlined-text-field-6a4e0ad20ae9