Media elements

It's easy to embed images, videos, and audio files directly into your Streamlit apps.

screenshot

Image

Display an image or list of images.

Python
st.image(numpy_array)
st.image(image_bytes)
st.image(file)
st.image("https://example.com/myimage.jpg")
screenshot

Logo

Display a logo in the upper-left corner of your app and its sidebar.

Python
st.logo("logo.jpg")
screenshot

PDF

Display a PDF file.

Python
st.pdf("my_document.pdf")
screenshot

Audio

Display an audio player.

Python
st.audio(numpy_array)
st.audio(audio_bytes)
st.audio(file)
st.audio("https://example.com/myaudio.mp3", format="audio/mp3")
screenshot

Video

Display a video player.

Python
st.video(numpy_array)
st.video(video_bytes)
st.video(file)
st.video("https://example.com/myvideo.mp4", format="video/mp4")

Third-party components

These are featured components created by our lovely community. For more examples and inspiration, check out our Components Gallery and Streamlit Extras!

screenshot

Streamlit Cropper

A simple image cropper for Streamlit. Created by @turner-anderson.

Python
from streamlit_cropper import st_cropper

st_cropper(img, realtime_update=realtime_update, box_color=box_color, aspect_ratio=aspect_ratio)
screenshot

Image Coordinates

Get the coordinates of clicks on an image. Created by @blackary.

Python
from streamlit_image_coordinates import streamlit_image_coordinates

streamlit_image_coordinates("https://placekitten.com/200/300")
screenshot

Streamlit Lottie

Integrate Lottie animations inside your Streamlit app. Created by @andfanilo.

Python
lottie_hello = load_lottieurl("https://assets5.lottiefiles.com/packages/lf20_V9t630.json")

st_lottie(lottie_hello, key="hello")
forum

Still have questions?

Our forums are full of helpful information and Streamlit experts.