How to implement float labels on NativeScript?


I used this tutorial to build my forms with css in Vue

I’d like to make it work on NativeScript, but the pseudo-selectors :valid and :focus aren’t supported. How can I make float labels work in NativeScript?


You can wrap the text field and label inside a layout, show and hide the label with animation when textfield is focused / blurred.


What is the selector for textfield in focus?


You can’t do that with CSS, use the events.


Thank you for your answers!