import solara
from typing import Union, Dict
@solara.component
def MyTextField(value: solara.Reactive[str], label: str="", label_style: Union[str, Dict[str, str]]=""):
style_flat = solara.util._flatten_style(label_style)
with solara.Row(style={"align-items": "center"}): # align-items makes all children float to the vertical center
solara.Text(label, style=label_style)
solara.InputText(label="", value=value, continuous_update=True)
@solara.component
def Page():
name = solara.use_reactive("")
MyTextField(name, "Enter your name", "color: red;")
solara.Markdown(f"Your name is: {name.value}")