New Component: streamlit-paste-button. Effortless Image Pasting in Your Streamlit Apps!

I’m excited to introduce you to streamlit-paste-button, a new component that simplifies image pasting within your Streamlit applications. Say goodbye to the hassle of selecting files from your desktop; with this component, you can effortlessly paste images directly from your clipboard into your app.

demo-paste-button

How does it work?

This component enables users to paste images from their clipboard (using the browser clipboard API after user consent), streamlining the user experience significantly. No more navigating through directories or dealing with file selection dialogs—just copy an image, click the button, and voila! Your image appears in your Streamlit app.

Which browsers is it compatible?

I tested on Microsoft Edge v120 and Google Chrome v120 on Windows and it works in both. Unfortunately in my tests it doesn’t work on mobile browsers.

Source code:

Pypi: streamlit-paste-button · PyPI
Demo App: Streamlit (paste-button.streamlit.app)


This is my first published component and my first post here in the community forum. If you have suggestions or questions feel free to drop your comments below. Thank you so much for reading :heart:

4 Likes

This is an amazing component!
On my Android phone I copied an image from Gallery (Copy to Clipboard) and “pasted” using Chrome and it worked!
Would be nice to be able to paste several images in a row, and have them all displayed on the page aligned vertically.