|
| 1 | +--- |
| 2 | +title: Share previews |
| 3 | +slug: /streamlit-cloud/get-started/share-your-app/share-previews |
| 4 | +--- |
| 5 | + |
| 6 | +# Share previews |
| 7 | + |
| 8 | +Social media sites generate a card with a title, preview image, and description when you share a link. This feature is called a "share preview." In the same way, when you share a link to a Streamlit app on social media, a share preview is also generated. Here's an example of a share preview for a public Streamlit app posted on Twitter: |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | +## Titles |
| 13 | + |
| 14 | +The title is the text that appears at the top of the share preview. The text also appears in the browser tab when you visit the app. You should set the title to something that will make sense to your app's audience and describe what the app does. It is best practice to keep the title concise, ideally under 60 characters. |
| 15 | + |
| 16 | +There are two ways to set the title of a share preview: |
| 17 | + |
| 18 | +1. Set the `page_title` parameter in [`st.set_page_config()`](/library/api-reference/utilities/st.set_page_config) to your desired title. E.g.: |
| 19 | + |
| 20 | + ```python |
| 21 | + import streamlit as st |
| 22 | + |
| 23 | + st.set_page_config(page_title="My App") |
| 24 | + |
| 25 | + # ... rest of your app |
| 26 | + ``` |
| 27 | + |
| 28 | +2. If you don't set the `page_title` parameter, the title of the share preview will be the name of your app's GitHub repository. E.g., if you don't set the `page_title` parameter in `st.set_page_config()`, the title of the share preview for an app hosted on GitHub at https://github.com/jrieke/traingenerator will be "traingenerator". |
| 29 | + |
| 30 | +## Descriptions |
| 31 | + |
| 32 | +The description is the text that appears below the title in the share preview. The description should summarize what the app does and ideally should be under 160 characters. |
| 33 | + |
| 34 | +Streamlit pulls the description from the README in the app's GitHub repository. If there is no README, the description will default to: |
| 35 | + |
| 36 | +_This app was built in Streamlit! Check it out and visit https://streamlit.io for more awesome community apps. 🎈_ |
| 37 | + |
| 38 | +If you want your share previews to look great and want users to share your app and click on your links, you should write a good description in the README of your app’s GitHub repository |
| 39 | + |
| 40 | +## Preview images |
| 41 | + |
| 42 | +Community Cloud takes a screenshot of your app once a day and uses it as the preview image, unlike titles and descriptions, which are pulled directly from your app's code or GitHub repository. This screenshot may take up to 24 hours to update. |
| 43 | + |
| 44 | +## Public vs. private apps |
| 45 | + |
| 46 | +All of the above information applies to public apps. If you share a private app, the share preview will contain no information about your app. Instead, it will include a default title ("Streamlit app"), a default description ("This app was built in Streamlit! Check it out and visit https://streamlit.io for more awesome community apps. 🎈"), and a default preview image that contains the Streamlit logo: |
| 47 | + |
| 48 | +<div style={{ marginLeft: '10em' }}> |
| 49 | + <Flex> |
| 50 | + <Image caption="Default share preview for a private app" src="/images/streamlit-cloud/share-preview-private-app.png" /> |
| 51 | + </Flex> |
| 52 | +</div> |
| 53 | + |
| 54 | +If your app was initially public and you later made it private, the share preview will no longer contain any information about your app. It will look like the image above, containing a generic title, description, and image. However, the last publicly available data will be discoverable for up to 24 hours after the app is made private. |
0 commit comments