Skip to content

Latest commit

 

History

History
42 lines (32 loc) · 1.7 KB

File metadata and controls

42 lines (32 loc) · 1.7 KB

streamlit_pretty_notification_box

An alternative to its sibling but looks prettier. The ability to add a title is included.

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:

pretty.png

Its built on the streamlit custom components typescript template

To install it:

pip install streamlit-pretty-notification-box

Variables

  • icon: from here
  • title: title of the notification
  • 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 pretty_notification_box import notification_box
st.subheader("Component with constant args")

styles = {'material-icons':{'color': 'red'},
          'title': {'font-weight':'bold'},
          'notification-content-container': {'':''},
          'title-text-url-container': {'',''},
          'notification-text-link-close-container': {'',''},
          'external-link': {'',''},
          'close-button': {'',''}}

notification_box(icon='warning', title='Warning', textDisplay='Water levels are high, be careful', externalLink='view more details',
                                url='https://www.cdc.gov/healthywater', styles=None, key='foo')