IPyWidgets Gallery is a library of interactive widgets for Jupyter notebooks. It provides a collection of classes that can be used to create widgets with custom output and easy value access.
You can install IPyWidgets Gallery using pip:
pip install ipywidgets-gallery
IPyWidgets Gallery depends on the ipywidgets package, which must also be installed:
pip install ipywidgets
To use IPyWidgets Gallery in your Jupyter notebooks, you can import the classes
you need and create instances of them. For example, to create a dropdown
widget that displays the selected option and sets a .value attribute
, you can
use the DropdownWithOutput
class:
from ipywidgets_gallery import DropdownWithOutput
options = ['option 1', 'option 2', 'option 3']
dropdown = ipywidgets_gallery.DropdownWithOutput(options, default='option 1')
dropdown.value # 'option 1'
This will display a dropdown widget with the specified label and options, and
an output widget that displays the specified message (formatted with the
selected option) when an option is selected. The .value
attribute of the widget will be set to the selected option when an option is selected.
IPyWidgets Gallery provides a variety of other classes for creating widgets with different types of output and easy value access.
CheckboxWithOutput
ColorPickerWithOutput
DatePickerWithOutput
DropdownWithOutput
FilePickerWithOutput
IntSliderWithOutput
RadioButtonsWithOutput
RangeSliderWithOutput
SelectMultipleWithOutput
TextAreaWithOutput
ToggleButtonWithOutput
ToggleButtonGroupWithOutput
IPyWidgets Gallery is released under the MIT License. See the LICENSE file for details.