How can I add validation text box (StaticText)?

Hello Community, I am currently using the panel==0.13.0 version.

Does the panel support textbox validation?

  • I want to add validation to the text box or Static Text widget. Suppose, in the below image someone types the wrong dbname, then it should display Invalid with red color.

  • Or, for some other parameters, the value to be input by the user should be a string but if the user types an integer or float value, it should show the same functionality as in point one.

So, is there any way to achieve it?

def validate_fn(text):
    if text != "something":
        text_input.styles = {"color": "red"}

pn.bind(validate_fn, text_input)

Something like that I think