Skip to content

Playground and get started #1240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 65 additions & 43 deletions content/get-started/installation/_index.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
title: Install Streamlit
title: Set up your Streamlit development environment
slug: /get-started/installation
---

# Install Streamlit
# Set up your Streamlit development environment

There are multiple ways to set up your development environment and install Streamlit. Read below to
understand these options. Developing locally with Python installed on your own computer is the most
common scenario.

## Summary for experts
## Summary for experienced developers

1. Set up your Python development environment.
2. Run:
Expand All @@ -22,43 +22,65 @@ common scenario.
```
4. Jump to our [Basic concepts](/get-started/fundamentals/main-concepts).

## Installation steps for the rest of us

<TileContainer layout="list">

<RefCard href="/get-started/installation/command-line" size="half">

<h5>Option 1: I'm comfortable with the command line</h5>

Install Streamlit on your own machine using tools like `venv` and `pip`.

</RefCard>

<RefCard href="/get-started/installation/anaconda-distribution" size="half">

<h5>Option 2: I prefer a graphical interface</h5>

Install Streamlit using the Anaconda Distribution graphical user interface. This is also the best
approach if you're on Windows or don't have Python set up.

</RefCard>

<RefCard href="/get-started/installation/community-cloud" size="half">

<h5>Option 3: I'd rather use a cloud-based environment</h5>

Use Streamlit Community Cloud with GitHub Codespaces so you don't have to go through the trouble
of installing Python and setting up an environment.

</RefCard>

<RefCard href="/get-started/installation/streamlit-in-snowflake" size="half">

<h5>Option 4: I need something secure, controlled, and in the cloud</h5>

Use Streamlit in Snowflake to code your apps in the cloud, right alongside your
data with role-based access controls.

</RefCard>

</TileContainer>
## General setup and installation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I think the previous wording made it clearer that if you're an expert you don't have to read the rest of these.

Copy link
Contributor Author

@sfc-gh-dmatthews sfc-gh-dmatthews Mar 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved the Playground up to highlight it further and added a little explainer blurb to emphasize to completely new or random passersby that the Playground is the easiet way to get a taste before choosing one of the local or cloud setup options below.


### Local development options

<p></p>

<InlineCalloutContainer>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're doing heroic work, but I think we need a design pass here.

I can take a pass directly in the code and share it with you. Or we can meet and do it live. LMK what you prefer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love our pair programming sessions and I think that will be faster. I was trying to mostly work within the components I already have, but I also have vague design ideas to go a little further. We can also talk about user journeys here. (Like whether someone might use the playground to walk through Basics or not.) 😁

<InlineCallout
color="orange-70"
icon="bolt"
bold="Streamlit Playground"
href="/get-started/installation/streamlit-playground"
>
<em>"Let me try it out as fast and easy as possible."</em><br />
Try out Streamlit in your browser. Visit the Streamlit Playground and start playing with code in seconds.
</InlineCallout>
<InlineCallout
color="indigo-70"
icon="terminal"
bold="Command line"
href="/get-started/installation/command-line"
>
<em>"I'm comfortable with the command line."</em><br />
Install Streamlit on your own machine using tools like `venv` and `pip`.
</InlineCallout>
<InlineCallout
color="indigo-70"
icon="mouse"
bold="Anaconda Distribution"
href="/get-started/installation/anaconda-distribution"
>
<em>"I prefer a graphical interface."</em><br />
Install Streamlit using the Anaconda Distribution graphical user interface. This is also the best approach if you're on Windows or
don't have Python set up yet.
</InlineCallout>
</InlineCalloutContainer>

### Cloud development options

<p></p>

<InlineCalloutContainer>
<InlineCallout
color="lightBlue-70"
icon="cloud"
bold="GitHub Codespaces"
href="/get-started/installation/community-cloud"
>
<em>"I want a preconfigured, cloud-based Docker environment."</em><br />
Use Streamlit Community Cloud with GitHub Codespaces so you don't have to go through the trouble of
installing Python and setting up an environment.
</InlineCallout>
<InlineCallout
color="lightBlue-70"
icon="shield"
bold="Streamlit in Snowflake"
href="/get-started/installation/streamlit-in-snowflake"
>
<em>"I need something secure, controlled, and in the cloud."</em><br />
Use Streamlit in Snowflake to code your apps in the cloud, right alongside your data with role-based access controls.
</InlineCallout>
</InlineCalloutContainer>
53 changes: 53 additions & 0 deletions content/get-started/installation/streamlit-playground.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: Use Streamlit Playground in your browser
slug: /get-started/installation/streamlit-playground
---

# Use Streamlit Playground in your browser

The fastest way to try out Streamlit is to try out our Playground! Streamlit Playground runs in your browser. Just visit the Playground, and a limited version of Streamlit loads as browser scripts.

Enjoy the following conveniences:

- Start playing with code right away, completely in your browser.
- No configuration.
- No command line.
- No application installations in your OS.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should make it clear that the playground doesn't support all Streamlit and Python features.

Copy link
Contributor Author

@sfc-gh-dmatthews sfc-gh-dmatthews Mar 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I call this out in the <Note> immediately following the conveniences list. Would making it two bullet points or two paragraphs make it clearer? Or maybe use <Important> instead of <Nonte>?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did the following:

  • Switched the <Note> to <Important>.
  • Moved the warning about local hardware out of the admonition, sprinkling it into the prerequisites and "wait" step.
  • Added emphasis to limited in the first paragraph.


<Note>
The Playground is dependendant on your computer's resources because it runs _locally_ in your browser. The setup time can vary depending on your machine and internet connection. Although the Playground has everything you need to get started, to access the full awesomeness of Streamlit, see [Install Streamlit using command line](/get-started/installation/command-line) or [Install Streamlit using Anaconda Distribution](/get-started/installation/anaconda-distribution).
</Note>

## Prerequisites

Because the Playground runs Streamlit in your browser, you should visit the Playground from a personal computer, not a mobile device.

## Go to the Playground

1. Go to [streamlit.io/playground](https://streamlit.io/playground).

1. Wait for [`stlite`](https://github.com/whitphx/stlite) &mdash; a browser-based version of Streamlit &mdash; to load in your browser.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you should mention stlite here. It's just confusing to the user.

Instead just say something like: Wait for the playground to load. Behind the scenes this downloads a version of Python and Streamlit that your browser can run, so this may take a bit of time.


This can take as little as a few seconds. However, it may take longer depending on your machine and internet. When Streamlit is done loading, an example app is displayed in the right panel.

![Streamlit Playground is fully loaded and ready to accept code edits](/images/get-started/Playground-1-loaded.png)

## Create a `Hello World` app
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe tell users to click on different example apps and play with them first?


1. From the "EXAMPLES" list, select "**Blank**."

1. On the left, update the contents of the code editor to contain the following code:

```python
import streamlit as st

st.title("Hello World")
```

A second or two after typing or pasting the code into the editor, the right panel will display the updated app. The code editor saves your edits whenever you pause from typing. Therefore, if you pause between keystrokes as you type a new line of code, you may see an error on the right because Streamlit executed an incomplete line. If this happens, just keep typing to complete the line(s) you are writing. When you pause again at the end of the line, Streamlit reruns the app.

## What's next?

Read about our [Basic concepts](/get-started/fundamentals/main-concepts) and try out more commands in your app.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "what's next" should point people toward installing Streamlit. Maybe something like:

What's next?

At this point you have two options:

  1. You can continue learning Streamlit through the playground -- great for learning and quick snippets.

  2. Or get started for real by installing Streamlit on your machine or the cloud.


When you use the Streamlit Playground to work through the basic concepts, you can skip over any instructions to save your file or to select "**Rerun on save**." Streamlit Playground automatically saves your code when you pause from editing, as described above. Also, it is already configured to rerun on save.
14 changes: 9 additions & 5 deletions content/menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ site_menu:
url: /get-started
color: orange-70
icon: rocket_launch
- category: Get started / Installation
- category: Get started / Setup
url: /get-started/installation
- category: Get started / Installation / Use command line
- category: Get started / Setup / LOCAL DEVELOPMENT
- category: Get started / Setup / Use Streamlit Playground ✨
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be under CLOUD DEVELOPMENT ?

Copy link
Contributor Author

@sfc-gh-dmatthews sfc-gh-dmatthews Mar 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It uses your machine's local resources, though. It runs in your browser, but uses your own hardware, not a cloud server.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved it up to highlight it separately, which brushes the distinction under the rug. :)

Copy link
Contributor

@sfc-gh-tteixeira sfc-gh-tteixeira Mar 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still feels funny...

I think the first thing under the Setup section needs to be how to install locally. Also, I guess the real problem is that it doesn't really feel like the playground belongs in the Setup section.

What if we pulled it out of that menu and renamed the menu to Installation?

  • Get started
    • Playground
    • Installation
      • LOCAL DEVELOPMENT
      • Install via command line
      • Install via Anaconda Distribution
      • CLOUD DEVELOPMENT
      • Use GitHub Codespaces
      • Use Snowflake
    • Fundamentals
    • First steps
  • Develop
  • Deploy
  • Knowledge base

url: /get-started/installation/streamlit-playground
- category: Get started / Setup / Install via command line
url: /get-started/installation/command-line
- category: Get started / Installation / Use Anaconda Distribution
- category: Get started / Setup / Install via Anaconda Distribution
url: /get-started/installation/anaconda-distribution
- category: Get started / Installation / Use GitHub Codespaces
- category: Get started / Setup / CLOUD DEVELOPMENT
- category: Get started / Setup / Use GitHub Codespaces
url: /get-started/installation/community-cloud
- category: Get started / Installation / Use Snowflake
- category: Get started / Setup / Use Snowflake
url: /get-started/installation/streamlit-in-snowflake
- category: Get started / Fundamentals
url: /get-started/fundamentals
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.