Path: blob/main/doc/how_to/streamlit_migration/widgets.md
2012 views
Accepting User Inputs with Widgets
In Panel the objects that can accept user inputs are called widgets.
Panel provides widgets similar to the ones you know from Streamlit and some unique ones in addition.
Migration Steps
To migrate your app's input widgets to Panel:
Replace your Streamlit
st.some_widget
function with the corresponding Panelpn.widgets.SomeWidget
class.
You can identify the corresponding widget via the Widgets Section of the Component Gallery.
Example
Integer Slider Example
Lets try to migrate an app using integer slider.
Streamlit Integer Slider Example
Panel Integer Slider Example
You will find Panels input widgets in pn.widgets
module.
Please note that in Panel bins
is an instance of IntSlider
and not an integer value. To access the value of bins
in Panel, you would need to call bins.value
.
Check out the IntSlider
Guide if you want to learn more about it.