{"library":"streamlit-avatar","title":"Streamlit Avatar","type":"library","description":"streamlit-avatar is a Streamlit component designed to easily display avatar icons within Streamlit applications. It supports showing avatars from image URLs or displaying text/initials. The current version is 0.1.3, and it generally follows the Streamlit component release cycle, with updates as needed for compatibility or new features.","language":"python","status":"active","last_verified":"Fri Apr 17","install":{"commands":["pip install streamlit-avatar"],"cli":null},"imports":["from streamlit_avatar import st_avatar"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":null,"github":"https://github.com/ppspps824/streamlit_avatar","docs":null,"changelog":null,"pypi":"https://pypi.org/project/streamlit-avatar/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"import streamlit as st\nfrom streamlit_avatar import st_avatar\n\nst.set_page_config(layout=\"wide\")\n\nst.title(\"Streamlit Avatar Example\")\n\n# Example 1: Image avatar from a URL\nst.header(\"1. Image Avatar\")\nst.markdown(\"Displays an image from a URL. Click to open GitHub.\")\nst_avatar(\n    url=\"https://avatars.githubusercontent.com/u/84214537?v=4\",\n    size=80,\n    border_radius=50,\n    border_color=\"#007BFF\",\n    border_hover_color=\"#0056B3\",\n    open_url_on_click=\"https://github.com/ppspps824\"\n)\n\n# Example 2: Text avatar (initials)\nst.header(\"2. Text Avatar (Initials)\")\nst.markdown(\"Displays text (e.g., initials) by setting `is_image=False`.\")\nst_avatar(\n    url=\"SA\", # The text to display\n    size=60,\n    is_image=False,\n    title_font_size=24,\n    title_color=\"#FFF\",\n    border_radius=10,\n    border_color=\"#28A745\",\n    border_hover_color=\"#218838\"\n)\n\nst.write(\"---\")\nst.write(\"Avatars demonstrated above.\")","lang":"python","description":"This example demonstrates how to display both an image-based avatar from a URL and a text-based avatar (e.g., initials) using the `streamlit_avatar` component. It showcases setting size, border styles, and click actions.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}