🐱 App logo
Submitted by Zachary Blackwood
Summary
Add a logo on top of the navigation bar of a multipage app
Functions
add_logo
Add a logo (and optionally a title and subtitle) on the top of the navigation page of a multipage app. Is it possible to choose also the color and the position of both element, if above or below the Logo. The url can either be a URL to the image or a local path to the image.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
logo_url |
str
|
URL/local path of the logo |
required |
title |
str
|
Title to be displayed above or below the logo, depending on switch_position. |
''
|
subtitle |
str
|
Subtitle to be displayed below the name or above the logo, depending on switch_position. |
''
|
height |
int
|
Height of the logo. Defaults to 200. |
200
|
color |
str
|
Color of title and subtitle. Default to black. |
'black'
|
switch_position |
bool
|
Switches the position of the logo and title if True. Defaults to False, so first Title and later Logo, as order. |
False
|
Source code in src/streamlit_extras/app_logo/__init__.py
Import:
- You should add this to the top of your .py file
Examples
example
def example():
if st.checkbox("Use url", value=True):
add_logo("http://placekitten.com/120/120")
else:
add_logo("gallery/kitty.jpeg", height=300)
st.write("👈 Check out the cat in the nav-bar!")