Documentation

search

Search

  • 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
Previous: API referenceNext: st.write
forum

Still have questions?

Our forums are full of helpful information and Streamlit experts.


HomeContact UsCommunity
© 2025 Snowflake Inc.