# Use interactive widgets

> **Warning:**
> The following is only valid when the Python and Jupyter plugins are [installed and enabled](managing-plugins.html)!

IntelliJ IDEA supports interactive widgets that provide integration between Python code running in the notebook kernel and JavaScript running in the browser.

For more details about the variety and specifics of interactive widgets, refer to [Jupyter widgets
documentation](https://ipywidgets.readthedocs.io/en/latest/examples/Widget%20List.html).

## Adding widget code to your Jupyter notebook

To add an interactive widget to your notebook, first add a code cell.

To preview the widgets, you need to [execute](running-jupyter-notebook-cells.html#execute-cell) the corresponding code cell.

> **Note:**
> When you switch the IntelliJ IDEA theme, the background color of an interactive output changes once you execute the code cell

Light:

![Viewing the output of the interactive widget in the light theme](https://resources.jetbrains.com.cn/help/img/idea/2026.2/py_interactive_output_light.png)

Dark:

![Viewing the output of the interactive widget in the light theme](https://resources.jetbrains.com.cn/help/img/idea/2026.2/py_interactive_output_dark.png)

## Handling security requirements

If you open any JavaScript or HTML code in a notebook file created outside of your project, that notebook is considered untrusted. According to the [security model](https://jupyter-notebook.readthedocs.io/en/4.x/security.html) established for Jupyter notebooks, untrusted JavaScript code is never executed, and untrusted HTML code is always sanitized.

That's why, for example, when you try to execute HTML in such a notebook, you will receive an error message: `This output uses HTML that may be stripped because the notebook is not trusted`.

Click Trust Notebook checkbox on the Jupyter notebook toolbar or Mark notebook trusted to explicitly allow executing HTML (JavaScript) in your Jupyter notebook.

![Making the notebook trusted](https://resources.jetbrains.com.cn/help/img/idea/2026.2/py_ipwidgets_trusted.png)

## See also

### Language and Framework-Specific Guidelines

[Jupyter notebook support](jupyter-notebook-support.html)

