Input widgets
With widgets, Streamlit allows you to bake interactivity directly into your apps with buttons, sliders, text inputs, and more.
Button
Display a button widget.
clicked = st.button("Click me")
Download button
Display a download button widget.
st.download_button("Download file", file)
Checkbox
Display a checkbox widget.
selected = st.checkbox("I agree")
Radio
Display a radio button widget.
choice = st.radio("Pick one", ["cats", "dogs"])
Selectbox
Display a select widget.
choice = st.selectbox("Pick one", ["cats", "dogs"])
Multiselect
Display a multiselect widget. The multiselect widget starts as empty.
choices = st.multiselect("Buy", ["milk", "apples", "potatoes"])
Slider
Display a slider widget.
number = st.slider("Pick a number", 0, 100)
Select-slider
Display a slider widget to select items from a list.
size = st.select_slider("Pick a size", ["S", "M", "L"])
Text input
Display a single-line text input widget.
name = st.text_input("First name")
Number input
Display a numeric input widget.
choice = st.number_input("Pick a number", 0, 10)
Text-area
Display a multi-line text input widget.
text = st.text_area("Text to translate")
Date input
Display a date input widget.
date = st.date_input("Your birthday")
Time input
Display a time input widget.
time = st.time_input("Meeting time")
File Uploader
Display a file uploader widget.
data = st.file_uploader("Upload a CSV")
Camera input
Display a widget that allows users to upload images directly a camera.
image = st.camera_input("Take a picture")
Color picker
Display a color picker widget.
color = st.color_picker("Pick a color")