Streamlit is a Python library that makes building beautiful, interactive apps in a few lines of code easy. But every new library has its quirks and conventions, and it takes time to learn. You might be wondering where to start and if there are any resources. No worries. I got you covered!
Let’s learn Streamlit with this guide called Streamlit Quests. It’s inspired by role-playing games where players navigate the landscape by completing a sequential set of tasks—quests.
Your learning journey will have two quests:
- 👨💻 Expert Quest. This is a sequential track. Learning starts as easy and gradually becomes more complex.
- 🎈 Community Quest. This is a non-sequential track. You can refer to these resources at any point in your journey.
The topics checklist below serves a dual purpose: a table of contents and a to-do checklist that you can refer to at any time (think of it as your compass in your learning journey of Streamlit):
|▢||Install Streamlit 👨💻|
|▢||Run the demo app via
|▢||Create a single-page app 👨💻|
|▢||Use the Streamlit App Starter Kit to quickly build a single-page app 🎈|
|▢||Read the Documentation for specific information on Streamlit commands at
|▢||Get inspiration by exploring Streamlit apps in the Gallery at
|▢||Use or create Streamlit Components (third-party modules that extend Streamlit functionality) at
|▢||Explore hundreds of components from the Streamlit Components Hub 🎈|
|▢||Create a multipage app 👨💻|
|▢||Use the Streamlit Multipage App Starter Kit to quickly build a multipage app 🎈|
|▢||Deploy a Streamlit app on Streamlit Community Cloud at
|▢||Share your Streamlit app on Twitter/LinkedIn and tag us
|▢||Get unstuck by asking the forum at
|▢||Read our blog to stay updated on the latest developments and use cases at
Let’s get started!
The simplest way to install Streamlit is by using
pip. Just type the following into the command line:
pip install streamlit
Run the demo app
After installing Streamlit, run the demo app by typing the following into the command line:
In a few moments, a new browser should launch, displaying the following demo app:
It showcases a wide range of Streamlit functionalities to show you what you can build.
Create a single-page app
In most cases, a basic app that performs a new task could be performed by a single-page app. Conceptually, the app has a single page that’s sitting in the
Or better yet…
Use the Streamlit App Starter Kit
Read the Documentation
In-depth coverage of every Streamlit command, along with code examples, is provided in the Streamlit Documentation at
https://docs.streamlit.io. There are also Getting Started articles, cheat sheets, tutorials, and knowledge base articles. In addition to coverage of the Streamlit library, there’s also content on the Streamlit Community Cloud.
When building Streamlit apps, I keep the Documentation handy for quick and easy reference. I can always find a suitable Streamlit command or code examples to repurpose for my apps.
30 Days of Streamlit helps new users learn the Streamlit library. We launched it on April 1, 2022, releasing a new challenge daily (with three difficulty levels). Then we compiled them all into a public app
The app encourages you to share your progress with the community by posting it on Twitter or LinkedIn with the hashtag
#30DaysOfStreamlit or by tagging
@streamlit (so we can retweet it). It’s now available in Portuguese, French, Spanish, and Russian.
Want to help translate it into your language? Go to
https://github.com/streamlit/30days to get started.
Get inspiration by exploring Streamlit apps in the Gallery
The Streamlit Gallery (available at
https://streamlit.io/gallery) is a collection of the best apps built with our framework. Here you can find inspiration for your next app by browsing through the apps or learning how to build a particular type of app by looking at their code. The apps are categorized by topic: science and technology, finance and business, data visualization, etc.
Use or create Streamlit Components
Streamlit components are third-party modules that extend Streamlit’s functionality of Streamlit. A curated collection is provided at
To use a Streamlit component such as AgGrid:
1. Install via
pip as follows:
pip install streamlit-aggrid
2. Use in a Streamlit app by simply importing the component and using its function:
from st_aggrid import AgGrid AgGrid(my_dataframe)
To create your own Streamlit component, refer to some of these excellent articles:
- How to build your own Streamlit component: Learn how to make a component from scratch!
- Introducing Streamlit Components: A new way to add and share custom functionality for Streamlit apps
- Documentation on Custom Components (contains additional information on creating and publishing components as well as the components API)
- Streamlit Components, security, and a five-month quest to ship a single line of code
And check out this 2-part tutorial video series:
- How to build a Streamlit component - Part 1: Setup and architecture
- How to build a Streamlit component - Part 2: Make a slider widget
Create a multipage app
A more complex app may require several pages. As a result, you might want to look into building a multipage app. The app consists of two major components:
- The main page that serves as the entry point of the multipage app.
- One of several pages that reside inside a
pagesfolder is called upon when users click on the page of interest from the left sidebar panel.
Learn how to build a multipage app in this article.
Use the Streamlit Multipage App Starter Kit
Just like with the Streamlit App Starter Kit for single-page apps, check out the fully functional early version of the Streamlit Multipage App Starter (an article about this coming soon) to make a multipage app in no time.
Deploy a Streamlit app on Streamlit Community Cloud
Let’s say you’ve already built your Streamlit app and want to share it with the community. You can share it by using Streamlit Community Cloud at
To deploy to the Community Cloud:
- Upload or Git-push app files to a GitHub repository
- From within Community Cloud, click on “New app,” then select repo, branch, and app file.
That’s it! Once the app is up and running, share its uniquely generated URL with the community.
Share your Streamlit app
Ready to share your Streamlit app creation with the community? Hop on Twitter or LinkedIn and tag us with
@streamlit. It’s a great way to contribute to the community and receive helpful and constructive feedback for improving your app.
Get unstuck by asking the forum
Are you encountering errors when creating Streamlit apps? To get unstuck, try the following:
- Read the error logs displayed in the command line as apps load. These errors will tell you exactly why certain aspects of the app may fail to load or display. They will also hint at which dependent libraries may be the root of the problem.
- Search Google, Stack Overflow, or the Streamlit Forum (
https://discuss.streamlit.io) to see if there are related posts that may already have a solution.
- If you’ve done the above and are still stuck, post your question on the Streamlit Forum. See this article How to post a question in the Streamlit forum to craft a thoughtful and practical question.
Read our blog to stay updated on the latest developments
Blog posts are a great way to stay updated on the latest developments and use cases, especially regarding the Streamlit web framework.
The Streamlit Blog (available at
https://blog.streamlit.io) is home to 106 articles (as of this writing) that provide timely information on new features, product releases, and other news that can help you stay ahead of the curve. It also features guest posts from experts in the field, which can provide valuable insights into best practices and real-world applications as they share their first-hand experiences.
Congratulations! You’ve been acquainted with all the essential resources for building Streamlit apps. It’s time to take what you’ve learned and create something extraordinary!
Happy Streamlit-ing! 🎈