Path: blob/main/doc/how_to/custom_components/custom_viewer.md
2011 views
Combine Existing Components
This guide addresses how to build custom components that are combinations of existing components.
The simplest way to extend Panel is to implement a so called Viewer
component that can wrap multiple existing Panel components into an easily reusable unit that behaves like a native Panel component.
Let's create a composite EditableRange
component made up of two FloatInput
widgets. First, we will create the widgets:
Then, we set up callbacks to sync the parameters on the underlying widgets with the parameters on the Viewer
component.
Finally, we'll implement the required __panel__
method, which returns the Panel layout to be rendered. Panel will call this method when displaying the component.
Related Resources
To create custom components from scratch, check out How To > Build Components from Scratch and read the associated Explanation > Building Custom Components for further explanation.