Documentation

search

Search

Ctrl-K

Change to dark mode

  • rocket_launch

    Get started

    • Installation
      add
    • Fundamentals
      add
    • First steps
      add
  • code

    Develop

    • Concepts
      add
    • API reference
      remove
      • PAGE ELEMENTS
      • Write and magic
        remove
        • st.write
        • st.write_stream
        • magic
      • Text elements
        add
      • Data elements
        add
      • Chart elements
        add
      • Input widgets
        add
      • Media elements
        add
      • Layouts and containers
        add
      • Chat elements
        add
      • Status elements
        add
      • Third-party componentsopen_in_new
      • APPLICATION LOGIC
      • Authentication and user info
        add
      • Navigation and pages
        add
      • Execution flow
        add
      • Caching and state
        add
      • Connections and secrets
        add
      • Custom components
        add
      • Configuration
        add
      • TOOLS
      • App testing
        add
      • Command line
        add
    • Tutorials
      add
    • Quick reference
      add
  • web_asset

    Deploy

    • Concepts
      add
    • Streamlit Community Cloud
      add
    • Snowflake
    • Other platforms
      add
  • school

    Knowledge base

    • FAQ
    • Installing dependencies
    • Deployment issues
  • Home/
  • Develop/
  • API reference/
  • Write and magic

st.write and magic commands

Streamlit has two easy ways to display information into your app, which should typically be the first thing you try: st.write and magic.

st.write

Write arguments to the app.

st.write("Hello **world**!") st.write(my_data_frame) st.write(my_mpl_figure)

st.write_stream

Write generators or streams to the app with a typewriter effect.

st.write_stream(my_generator) st.write_stream(my_llm_stream)

Magic

Any time Streamlit sees either a variable or literal value on its own line, it automatically writes that to your app using st.write

"Hello **world**!" my_data_frame my_mpl_figure
arrow_backPrevious: API referencearrow_forwardNext: st.write
forum

Still have questions?

Our forums are full of helpful information and Streamlit experts.


HomeContact UsCommunity
© 2025 Snowflake Inc.

We use cookies to help us understand how you interact with our website. By clicking “Accept All Cookies” or closing this banner, you consent to our use of cookies. For more information, please see our Privacy Notice.
Company Logo

Privacy Preference Center

Privacy Preference Center

  • Your Privacy

  • Strictly Necessary Cookies

  • Targeting Cookies

Your Privacy

When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer.
More information

Strictly Necessary Cookies

Always Active

These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms. You can set your browser to block or alert you about these cookies, but some parts of the site will not then work. These cookies do not store any personally identifiable information.

Targeting Cookies

These cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly identifiable personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising.

Cookie List

Consent Leg.Interest
label
label
label
  • label
Powered by Onetrust