Booleanstatus

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


In [1]:
import panel as pn

pn.extension()

The BooleanStatus is a boolean indicator providing a visual representation of a boolean status as filled or non-filled circle. If the value is set to True the indicator will be filled while setting it to False will cause it to be non-filled.

Parameters:

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

  • color (str): The color of the bar, one of 'primary', 'secondary', 'success', 'info', 'warn', 'danger', 'light', 'dark'
  • value (int or None): Whether the status indicator is filled or not.

The BooleanStatus widget can be instantiated as either False or True:

In [2]:
false_status = pn.indicators.BooleanStatus(value=False)
true_status = pn.indicators.BooleanStatus(value=True)

pn.Row(false_status, true_status)
Out[2]:

The BooleanStatus indicator also supports a range of colors:

In [3]:
grid = pn.GridBox('', 'False', 'True', ncols=3)

for color in pn.indicators.BooleanStatus.param.color.objects:
    false = pn.indicators.BooleanStatus(width=50, height=50, value=False, color=color)
    true = pn.indicators.BooleanStatus(width=50, height=50, value=True, color=color)
    grid.extend((color, false, true))

grid
Out[3]:

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