Discover our Custom UI showcase app for Streamlit! 🎨✨
Custom UI enables customization of the look, feel, and front-end behavior of Streamlit in Snowflake apps. This feature supports the following:
- Custom HTML and CSS using
unsafe_allow_html=True
in st.markdown. - Iframed HTML, CSS, and JavaScript using st.components.v1.html.
This app demonstrates how you can transform the default Streamlit interface by applying custom styles to various elements such as buttons, text, and containers. By leveraging CSS, the app provides a more personalized experience, illustrating the flexibility and aesthetic potential of combining Streamlit's interactive features with custom styling.
👉 Make sure to also check out the "Custom UI Features" mode for more examples of what's possible, and source code to get started.
Custom UI for Streamlit in Snowflake is currently in Public Preview. Read the docs to learn more.
-
Open a new SQL Worksheet.
-
Copy the contents of the file
data/creation_script.sql
into the Worksheet. Execute theCREATE
statements of the script, which creates a database and schema. -
When you create a new Streamlit App, Snowflake automatically generates a new stage for this app. Access this stage in the Data section on the left side of the screen. Navigate to Databases, find the database associated with your Streamlit App (e.g.,
SAMPLEDATABASE.CUSTOM_UI
).
- Select the database, then choose the schema where you created the Streamlit App (e.g., public).
- Navigate to Stages to view the available stages. Snowflake has automatically created a Stage with an autogenerated name.
- Click on the stage name. The first time, it will prompt you to “Enable Directory Listing”. Click on that button.
- Choose a warehouse.
-
Click on “+ Files” in the upper right corner to open a popup where you can add the required files.
-
Upload the files by clicking on the "Upload" button in the lower right corner. Note that if a file has the same name as an existing file in the stage, the new file will overwrite the previous one (Select all the files in the root of the folder).
- With these steps, you have successfully uploaded files into your Streamlit App.