Loadingspinner

Download this notebook from GitHub (right-click to download).


import panel as pn

pn.extension()

The LoadingSpinner is a boolean indicator providing a visual representation of the loading status. If the value is set to True the spinner will rotate while setting it to False will disable the rotating segment.

Parameters:

For layout and styling related parameters see the customization user guide.

  • bgcolor (str): The color of spinner background segment, either ‘light’ or ‘dark’

  • color (str): The color of the spinning segment, one of ‘primary’, ‘secondary’, ‘success’, ‘info’, ‘warn’, ‘danger’, ‘light’, ‘dark’

  • value (boolean): Whether the indicator is spinning or not.


The LoadingSpinner can be instantiated in a spinning or idle state:

idle = pn.indicators.LoadingSpinner(value=False, width=100, height=100)
loading = pn.indicators.LoadingSpinner(value=True, width=100, height=100)

pn.Row(idle, loading)

The LoadingSpinner indicator also supports a range of spinner colors and backgrounds:

grid = pn.GridBox('', 'light', 'dark', ncols=3)

for color in pn.indicators.LoadingSpinner.param.color.objects:
    dark = pn.indicators.LoadingSpinner(width=50, height=50, value=True, color=color, bgcolor='dark')
    light = pn.indicators.LoadingSpinner(width=50, height=50, value=True, color=color, bgcolor='light')
    grid.extend((color, light, dark))

grid
This web page was generated from a Jupyter notebook and not all interactivity will work on this website. Right click to download and run locally for full Python-backed interactivity.

Download this notebook from GitHub (right-click to download).