Skip to main content

streamlit-comments supports replies and multi-level replies.

pip install streamlit-comments

demo

event = st_comments(
    key="test",
    currentUserId="01a",
    currentUserFullName="Riya Negi",
    titleStyle={ "display": "none" },
    hrStyle={ "display": "none" },
    commentData=[],
    customNoComment=" ",
)

demo1

test_data = [
    {
        "userId": "01a",
        "comId": "012",
        "fullName": "Riya Negi",
        "text": "Hey, Loved your blog! ",
        "createdTime": 1688646541266,
        "replies": [
            {
                "userId": "02a",
                "comId": "013",
                "fullName": "Adam Scott",
                "createdTime": 1688646541266,
                "text": "Thanks! It took me 1 month to finish this project but I am glad it helped out someone!🥰",
                "replies": [
                    {
                        "userId": "05a",
                        "comId": "020",
                        "fullName": "aaaaa",
                        "createdTime": 1688646541266,
                        "text": "test",
                    }
                ]
            },
            {
                "userId": "01a",
                "comId": "014",
                "fullName": "Riya Negi",
                "text": "thanks!😊",
                "createdTime": 1688646541266,
            }
        ]
        },
    {
        "userId": "02b",
        "comId": "017",
        "fullName": "Lily",
        "text": "I have a doubt about the 4th point🤔",
        "replies": [],
        "createdTime": 1688646541266,
    }
]

event = st_comments(
    key="test2",
    currentUserId="01a",
    currentUserFullName="Riya Negi",
    commentData=test_data,
)
st.write(event)

demp2

   event = st_comments(
      key="test3",
      currentUserId="01a",
      currentUserFullName="Riya Negi",
      currentUserImg="https://ui-avatars.com/api/name=Riya&background=random",
      hrStyle={ "border": '0.5px solid #ff0072' },
      titleStyle={ "color": '#f2f2f2' },
      commentsCount=5,
      commentData=test_data,
      imgStyle={ "borderRadius": '0%' },
      customImg='https://imagesvc.meredithcorp.io/v3/mm/image?url=https%3A%2F%2Fstatic.onecms.io%2Fwp-content%2Fuploads%2Fsites%2F13%2F2015%2F04%2F05%2Ffeatured.jpg&q=60',
      inputStyle={ "border": '1px solid rgb(208 208 208)' },
      formStyle={ "backgroundColor": 'white' },
      submitBtnStyle={ "border": '1px solid black', "backgroundColor": 'black' },
      cancelBtnStyle={
        "border": '1px solid gray',
        "backgroundColor": 'gray',
        "color": 'white',
      },
      removeEmoji=True,
      overlayStyle={ "backgroundColor": '#0f0d29', "color": 'white' },
      replyInputStyle={ "borderBottom": '1px solid black', "color": 'black' },
  )
  st.write(event)

demo3

  event = st_comments(
      key="test4",
      currentUserId='01a',
      currentUserImg='https://ui-avatars.com/api/name=Riya&background=random',
      currentUserFullName='Riya Negi',
      hrStyle={ "border": '0.5px solid #ff0072' },
      commentData=test_data,
      customImg='https://imagesvc.meredithcorp.io/v3/mm/image?url=https%3A%2F%2Fstatic.onecms.io%2Fwp-content%2Fuploads%2Fsites%2F13%2F2015%2F04%2F05%2Ffeatured.jpg&q=60',
      inputStyle={ "border": '1px solid rgb(208 208 208)' },
      formStyle={ "backgroundColor": 'white' },
      submitBtnStyle={
        "border": '1px solid black',
        "backgroundColor": 'black',
        "padding": '7px 15px',
      },
      cancelBtnStyle={
        "border": '1px solid gray',
        "backgroundColor": 'gray',
        "color": 'white',
        "padding": '7px 15px'
      },
      advancedInput=True,
      replyInputStyle={ "borderBottom": '1px solid black', "color": 'black' },
  )

Metadata

Release files for streamlit-comments 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for streamlit-comments 0.0.7
File Size Uploaded
streamlit-comments-0.0.7.tar.gz 347.8 kB Details

Release files / streamlit-comments-0.0.7.tar.gz

Download URL streamlit-comments-0.0.7.tar.gz
Size 347.8 kB
Tags Source
SHA-256 checksum
How to use checksums
65e5874a98c73b919cc456215af743f956564fcaa7762b8bd7ef51254769dc0c
BLAKE2b-256 checksum
How to use checksums
d14fdeb7a542fefa3cf849a57d3e6b700788e7ceb5f8032b5170e64f3e8ff486
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.18

Release history Release notifications | RSS feed

This release

0.0.7 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page