Introducing Streamlit Components

A new way to add and share custom functionality for Streamlit apps

Adrien Treuille
Jul 14 · 5 min read

The Streamlit Components Gallery

Image for post
Image for post
pip install some_cool_component

Building your own components

import streamlit as stx = st.slider('x')
st.markdown(f'`{x}` squared is `{x * x}`')
Image for post
Image for post

Static Components

# Render a gist
github_gist('tc87', '9382eafdb6eebde0bca0c33080d54b58')
Image for post
Image for post
import streamlit.components.v1 as components

Getting widget with it!

count = counter(name="Fanilo")
st.write('The count is', count)
Image for post
Image for post
# Declare a simple counter component.
import streamlit.components.v1 as components
counter = components.declare_component("counter", path=BUILD_PATH)
components.declare_component(name, url="http://localhost:3001")      

Sharing with the world

Try it out and let us know what you think!


Streamlit

Streamlit is the fastest way to create data apps.

Adrien Treuille

Written by

Adrien is co-founder of Streamlit, the ML tooling framework. Adrien was a computer science prof at Carnegie Mellon, lead a Google X project, and was VP at Zoox.

Streamlit

Streamlit

Streamlit is the fastest way to create data apps. Streamlit’s open-source app framework enables data scientists and machine learning engineers to create beautiful, performant apps in only a few hours! Want to test it out? In a terminal -> $ pip install streamlit

Adrien Treuille

Written by

Adrien is co-founder of Streamlit, the ML tooling framework. Adrien was a computer science prof at Carnegie Mellon, lead a Google X project, and was VP at Zoox.

Streamlit

Streamlit

Streamlit is the fastest way to create data apps. Streamlit’s open-source app framework enables data scientists and machine learning engineers to create beautiful, performant apps in only a few hours! Want to test it out? In a terminal -> $ pip install streamlit

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store