<jupyter_start><jupyter_text>The ``IPyWidget`` pane renders any ipywidgets model both in the notebook and in a deployed server. This makes it possible to leverage this growing ecosystem directly from within Panel simply by wrapping the component in a Pane or Panel.In the notebook this is not necessary since Panel simply uses the regular notebook ipywidget renderer. Particularly in JupyterLab importing the ipywidgets extension in this way may interfere with the UI and render the JupyterLab UI unusable, so enable the extension with care. Parameters:For layout and styling related parameters see the [customization user guide](../../user_guide/Customization.ipynb).* **``object``** (object): The ipywidget object being displayed Display* **``default_layout``** (pn.layout.Panel, default=Row): Layout to wrap the plot and widgets in___ The `panel` function will automatically convert any ``ipywidgets`` object into a displayable panel, while keeping all of its interactive features:<jupyter_code>date   = ipw.DatePicker(description='Date')
slider = ipw.FloatSlider(description='Float')
play   = ipw.Play()

layout = ipw.HBox(children=[date, slider, play])

pn.panel(layout)<jupyter_output><empty_output><jupyter_text>Interactivity and callbacks Any ipywidget with a `value` parameter can also be used in a `pn.depends` decorated callback, e.g. here we declare a function that depends on the value of a `FloatSlider`:<jupyter_code>slider = ipw.IntSlider(description='Slider', min=-5, max=5)

@pn.depends(slider)
def cb(value):
    return 'The slider value is ' + (
        'negative' if value < 0 else 'nonnegative'
    )

pn.Row(slider, cb)<jupyter_output><empty_output><jupyter_text>If instead you want to write a callback yourself you can also use the `traitlets` `observe` method as you would usually. To read more about this see the [Widget Events](https://ipywidgets.readthedocs.io/en/stable/examples/Widget%20Events.html) section of the ipywidgets documentation.<jupyter_code>caption = ipw.Label(value='The slider value is nonnegative')
slider = ipw.IntSlider(min=-5, max=5, value=1, description='Slider')

def handle_slider_change(change):
    caption.value = 'The slider value is ' + (
        'negative' if change.new < 0 else 'nonnegative'
    )

slider.observe(handle_slider_change, names='value')

pn.Row(slider, caption)<jupyter_output><empty_output><jupyter_text>External widget libraries The `IPyWidget` panel is also not restricted to simple widgets, ipywidget libraries such as [`ipyvolume`](https://ipyvolume.readthedocs.io/en/latest/index.html) and [`ipyleaflet`](https://ipyleaflet.readthedocs.io/en/latest/) are also supported.<jupyter_code>import ipyvolume as ipv
x, y, z, u, v = ipv.examples.klein_bottle(draw=False)
fig = ipv.figure()
m = ipv.plot_mesh(x, y, z, wireframe=False)
ipv.squarelim()

pn.panel(fig)
from ipyleaflet import Map, VideoOverlay

m = Map(center=(25, -115), zoom=4)

video = VideoOverlay(
    url="https://www.mapbox.com/bites/00188/patricia_nasa.webm",
    bounds=((13, -130), (32, -100))
)

m.add_layer(video);

pn.panel(m)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11057382333978079, 'fraction_numerical': 0.009671179883945842, 'mean_word_length': 5.602127659574468, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 17, 'https://': 4, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '317022', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 999, 'n_tokens_neox': 958, 'n_words': 310, 'path': 'examples/reference/panes/IPyWidget.ipynb', 'repo_name': 'sthagen/holoviz-panel', 'size': '3102'}