
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
streamlit-custom-sidebar
Advanced tools
Streamlit component that allows you to do create a more flexible customisable streamlit sidebar
Streamlit component that allows you to do buid a more flexible customizable sidebar that does not look buggy when rendered. Usually when we try to adjust the native streamlit sidebar it gets rendered after all the streamlit default settings are rendered. With this, your default settings are rendered when the page loads but it still uses streamlit's sidebar mative settings - css like its open and close animation and buttons.
Dependencies: Uses other custom components I created:
pip install streamlit-custom-sidebar
# Pre-requisites
create `.streamlit/config.toml` directory where the main app.py file is located
in there, input
[ui]
hideSidebarNav=true
or
start streamlit app with
`streamlit run app.py --ui.hideSidebarNav=true`
import streamlit as st
from streamlit_custom_sidebar import CustomSidebarDefault
import streamlit_float # recommended
# Note - on the page's first load - when user comes in from the url rather than clicking on the tab, the active page will be derived from the url or from the `loadPageName` parameter. Please make sure all params in the data array object are inputed.
st.set_page_config(layout="wide")
streamlit_float.float_init(theme=False, include_unstable_primary=False)
# iconLib (key,variable in the data list of dicts - its required) -> "Remix", "Tabler", "Google"
data_ = [
{"index":0, "label":"Example", "page":"example", "href":"http://localhost:8501/"},
{"index":1, "label":"Page", "page":"page", "iconLib":"Google", "icon":"settings", "href":"http://localhost:8501/page"}
]
if "currentPage" not in st.session_state: # required as component will be looking for this in session state to change page via `switch_page`
st.session_state["currentPage"] = data_[0]
else:
st.session_state["currentPage"] = data_[0]
with st.container():
defaultSidebar = CustomSidebarDefault(closeNavOnLoad=False, backgroundColor="brown", loadPageName="example", data=data_, LocalOrSessionStorage=1, serverRendering=False, webMedium="local")
defaultSidebar.load_custom_sidebar()
defaultSidebar.change_page()
streamlit_float.float_parent(css="position:fixed; top:-1000px;") # gets rid of the whitespace created from the iframes used to build the component - no big forehead.
# The above must be rendered atop every streamlit page
FAQs
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.