Socvest / streamlit-custom-notification-box

A custom notification box for streamlit with the ability to close it out

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

streamlit-custom-notification-box

A custom notification box for streamlit with the ability to close it out

If you need a notification bar with the ability to redirect users to an external site (optional) and to pop up and be able to close it out, then give this a try. Its possible to change the colour, the image to correspond to the type of notification of your choice (warning, information, success etc). The image below is an example of information:

custom-notification-box.png

Its built on the streamlit custom components typescript template

To install it:

pip install streamlit-custom-notification-box

Variables

  • icon: from here
  • textDisplay: Text to display
  • externalLink: External link to send users to (optional)
  • url: The url that users will be sent to
  • styles: The optional CSS styling you want for the component
  • key
  • defaultIndex
from streamlit_custom_notification_box import custom_notification_box
st.subheader("Component with constant args")

styles = {'material-icons':{'color': 'red'},
          'text-icon-link-close-container': {'box-shadow': '#3896de 0px 4px'},
          'notification-text': {'':''},
          'close-button':{'':''},
          'link':{'':''}}

custom_notification_box(icon='info', textDisplay='We are almost done with your registration...', externalLink='more info', url='#', styles=styles, key="foo")

About

A custom notification box for streamlit with the ability to close it out

License:MIT License


Languages

Language:TypeScript 33.5%Language:Python 29.2%Language:CSS 17.9%Language:HTML 16.1%Language:Shell 3.3%