Socvest / streamlit_pretty_notification_box

Pretty notification box

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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')

About

Pretty notification box

License:MIT License


Languages

Language:TypeScript 36.0%Language:Python 29.1%Language:CSS 20.7%Language:HTML 14.3%