panel.layout.modal module#
- class panel.layout.modal.Modal(*objects: Any, **params: Any)[source]#
Bases:
ListPanel
Create a modal dialog that can be opened and closed.
Methods
create_button
(action, **kwargs)Create a button to show, hide or toggle the modal.
show
()Starts a Bokeh server and displays the Viewable in a new tab.
hide
toggle
Parameter Definitions
Parameters inherited from:
panel.viewable.Layoutable
: align, aspect_ratio, css_classes, design, height, min_width, min_height, max_width, max_height, margin, styles, stylesheets, tags, width, width_policy, height_policy, sizing_mode, visiblepanel.viewable.Viewable
: loadingpanel.layout.base.ListLike
: objectspanel.layout.base.ListPanel
: scrollopen = Boolean(default=False, label='Open')
Whether to open the modal.
show_close_button = Boolean(default=True, label='Show close button')
Whether to show a close button in the modal.
background_close = Boolean(default=True, label='Background close')
Whether to enable closing the modal when clicking the background.
- create_button(action: Literal['show', 'hide', 'toggle'], **kwargs)[source]#
Create a button to show, hide or toggle the modal.
- show()[source]#
Starts a Bokeh server and displays the Viewable in a new tab.
- Parameters:
- titlestr | None
A string title to give the Document (if served as an app)
- port: int (optional, default=0)
Allows specifying a specific port
- addressstr
The address the server should listen on for HTTP requests.
- websocket_origin: str or list(str) (optional)
A list of hosts that can connect to the websocket. This is typically required when embedding a server app in an external web site. If None, “localhost” is used.
- threaded: boolean (optional, default=False)
Whether to launch the Server on a separate thread, allowing interactive use.
- verbose: boolean (optional, default=True)
Whether to print the address and port
- openboolean (optional, default=True)
Whether to open the server in a new browser tab
- locationboolean or panel.io.location.Location
Whether to create a Location component to observe and set the URL location.
- Returns:
- server: bokeh.server.Server or panel.io.server.StoppableThread
Returns the Bokeh server instance or the thread the server was launched on (if threaded=True)