Streamlit Shorts: Core Functionality Series

Hey Community :wave:t3:,

We’re excited to announce a new media format called Streamlit Shorts - these will be a series of short (~90 seconds or less) YouTube videos that are designed to make developing, designing and most importantly, learning about Streamlit easy. :partying_face::tada:

The goal is to create a series of videos that will allow new (and experienced!) users of Streamlit a new way to learn (or remember) how to use, create and debug some of the most common Streamlit functions. We know that people have many different learning styles, and we hope this will help those visual and interactive learners out there! :star_struck:

The first series is on Streamlit’s core functions and the first short on the button!

Check it out below: :heart_eyes:

:tv: Video:

:desktop_computer: Sample code:

import streamlit as st 

st.title("Making a Button")

result = st.button('Click Here')
st.write(result)

if result:
    st.write(":smile:")

The second video of the series goes into how to make a checkbox:

:tv: Video:

:desktop_computer: Sample code:

import streamlit as st

st.title("Making a Checkbox")

check = st.checkbox("Click here")
st.write('State of the checkbox:', check)

if check:
   st.write(":smile:"*12)

check_2 = st.checkbox("Uncheck to remove cake", value=True)
st.write("State of 2nd checkbox", check_2)

if check_2:
   st.write(":cake:"*102)

The third video of the series goes into how to make a set of radio buttons:

:tv: Video:

:desktop_computer: Sample code:

import streamlit as st

st.title("Make a Radio Button")

page_names = ['Checkbox', 'Button']

page = st.radio('Navigation', page_names, index=1)
st.write("**The variable 'page' returns:**", page)

if page == 'Checkbox':
   st.subheader('Welcome to the Checkbox page!')
   st.write("Nice to see you! :wave:")
else:
   st.subheader("Welcome to the Button page!")
   st.write(":thumbsup:")

The fourth video of the series goes into how to make a slider:

:tv: Video:

:desktop_computer: Sample code:

import streamlit as st
st.title(“Streamlit Sliders”)
st.subheader(“Slider 1:“)
x = st.slider(‘A number between 0-100’, value=50) # defaults to 0-100
st.write(“Slider number:“, x)
st.subheader(“Slider 2:“)
y = st.slider(‘Choose between 0-1 by 0.1’, min_value=0.0, max_value=1.0, step=0.1)
st.write(“Slider number:“, y)

Have functionality or a question you’d like to see covered in a short? Let us know below :balloon:

8 Likes

Looking forward to seeing how this content builds up in 2021! I think a lot of people will be drawn to bite-sized videos :partying_face:

1 Like

The second video of the series goes into how to make a checkbox:

:tv: Video:

:desktop_computer: Sample code:

import streamlit as st

st.title("Making a Checkbox")

check = st.checkbox("Click here")
st.write('State of the checkbox:', check)

if check:
   st.write(":smile:"*12)

check_2 = st.checkbox("Uncheck to remove cake", value=True)
st.write("State of 2nd checkbox", check_2)

if check_2:
   st.write(":cake:"*102)
3 Likes

The third video of the series goes into how to make a set of radio buttons:

:tv: Video:

:desktop_computer: Sample code:

import streamlit as st

st.title("Make a Radio Button")

page_names = ['Checkbox', 'Button']

page = st.radio('Navigation', page_names, index=1)
st.write("**The variable 'page' returns:**", page)

if page == 'Checkbox':
   st.subheader('Welcome to the Checkbox page!')
   st.write("Nice to see you! :wave:")
else:
   st.subheader("Welcome to the Button page!")
   st.write(":thumbsup:")
2 Likes

The fourth video of the series goes into how to make a slider:

:tv: Video:

:desktop_computer: Sample code:

import streamlit as st
st.title(“Streamlit Sliders”)
st.subheader(“Slider 1:“)
x = st.slider(‘A number between 0-100’, value=50) # defaults to 0-100
st.write(“Slider number:“, x)
st.subheader(“Slider 2:“)
y = st.slider(‘Choose between 0-1 by 0.1’, min_value=0.0, max_value=1.0, step=0.1)
st.write(“Slider number:“, y)
3 Likes