5 Streamlit Features You May Have Missed
Five Streamlit additions worth knowing: Material icons and emojis in labels, button groups with st.segmented_control, pills with st.pills, the tertiary button style, and a CSS class for every widget key. Each one replaces a workaround you may still be writing by hand.
Icons and emojis in labels
Markdown text accepts Google Material icons with the :material/icon_name: syntax, and buttons take an icon argument that accepts an emoji or a Material icon. An icon often says what a button does in less space than a word.
st.markdown(
"You can use google materials icons, e.g. in markdown: :material/table_convert:"
)
st.button("Click me", icon="😲")

Button groups
st.segmented_control shows a set of options as one connected row of buttons. With selection_mode="multi" the user can pick several at once, and the function returns the selected options as a list. It works well for a small, fixed set of filters.
options = ["North", "East", "South", "West"]
selection = st.segmented_control("Directions", options, selection_mode="multi")
st.markdown(f"Your selected options: {selection}.")

Pills
st.pills takes the same arguments as the segmented control but draws each option as a separate rounded tag. It is a compact alternative to a multiselect dropdown when you have a handful of categories and want all of them visible.
options = ["North", "East", "South", "West"]
selection = st.pills("Directions", options, selection_mode="multi")
st.markdown(f"Your selected options: {selection}.")

Tertiary buttons
st.button now accepts type="tertiary" next to primary and secondary. A tertiary button has no border or fill and looks like plain text, so it suits minor actions that should not compete with the main one.
if st.button("Primary Button", type="primary"):
st.write("Ahoy")
if st.button("Secondary Button", type="secondary"):
st.write("Ahoy")
if st.button("Tertiary Button", type="tertiary"):
st.write("Ciao")

CSS classes from widget keys
Every widget with a key now gets a matching CSS class: key="green" becomes st-key-green. That gives your stylesheet a stable hook, so you can style one specific button without fragile selectors or styling every button in the app.
In the example below, load_css reads an external styles.css file and injects it with st.markdown. The stylesheet targets the two keys, which turns the first button green and gives the second one a pulse effect. For the full approach, see my tutorial on styling a Streamlit app with custom CSS.
import pathlib
import streamlit as st
def load_css(file_path):
with open(file_path) as f:
st.markdown(f"<style>{f.read()}</style>", unsafe_allow_html=True)
# Load the external CSS
css_path = pathlib.Path(__file__).parents[1] / "assets" / "styles.css"
load_css(css_path)
# Styled Button
st.header("Buttons")
st.button("I'm a green button", key="green")
if st.button("Full custom CSS tutorial", key="pulse"):
st.link_button(
label="check it out here...",
url="https://youtu.be/jbJpAdGlKVY",
)

For a bigger change of look, I also covered shadcn components inside Streamlit.
