S
Solara2w ago
W

Support for pop-up notifications?

Hello, Does Solara have support for pop ups on web apps? I didn’t see anything in the docs other than the success or warning messages, but could not figure out how to get them to disappear after showing up. Any ideas? All help is appreciated.
4 Replies
iisakkirotko
iisakkirotko2w ago
Hi @W!
iisakkirotko
iisakkirotko2w ago
I'm assuming by pop up you mean a dialog or a similar floating container? Solara has a ConfirmationDialog component that you can use for this purpose (see the docs). Otherwise you can access ipyvuetify components through solara.v, and use, for instance a snackbar component to communicate status
Vuetify
Snackbar component
The snackbar component informs user of a process that your application has performed is will perform. It can be temp...
iisakkirotko
iisakkirotko2w ago
If you want to see how you can use the Snackbar component in Solara you can take a look at the spots where it's used in the code of our website here
Monty Python
Monty Python2w ago
solara/website/components/contact.py lines 126 to 134
with solara.v.Snackbar(
v_model=error.value is not None,
timeout=5000,
on_v_model=lambda *_: error.set(None),
left=True,
color="error",
):
solara.Markdown(error.value or "", style={"--dark-color-text": "white", "--color-text": "white"})
solara.Button(icon=True, icon_name="mdi-close", color="white", on_click=lambda: error.set(None))
with solara.v.Snackbar(
v_model=error.value is not None,
timeout=5000,
on_v_model=lambda *_: error.set(None),
left=True,
color="error",
):
solara.Markdown(error.value or "", style={"--dark-color-text": "white", "--color-text": "white"})
solara.Button(icon=True, icon_name="mdi-close", color="white", on_click=lambda: error.set(None))

Did you find this page helpful?