How to make and size a pop-up window?

Dear Anvil Community

Apologies for another novice question, but this has me stumped. I am building a website based on a Plotly scatter plot (client-side). I want to create a small pop-up window with some data and an image when a point on the plot is clicked. I can show the data and image related to a particular point in a text box and image box outside the plot, but I am failing to implement this in a pop-up window. I have created a form for this with several components inside a column panel, but when opened it fills the screen so obscuring the scatter plot. I cannot find a way to set the dimensions of the pop-up window (for example, self.max_width/height under init has no effect). I also tried using hoverlabel, and while I can display the data I have failed to display an image. A pop-up window is the best solution for the website, and I feel it should be relatively easy to implement, but I must be missing something obvious.

Can anybody point me in the direction of an example app or tutorial. I remember an example of an image gallery with a nice pop-up for individual photos, but I cannot find the link.

Many thanks in advance.

Look at the documentation for alert.

It can be used to show a text or a form.

As stefano has mentioned it. Use alert

example:

#import your form that you want show as alert first
from ..AlertForm import AlertForm

      #open modal view
          modal =AlertForm()
          alert(modal, large=True, buttons=[], dismissible=False)

AlertForm is a name of the form that will appear as alert and don’t forget to set large=True

Many thanks Stefano and KR1, I will try using alerts.