gamcoh / st-card

Streamlit component for UI cards
https://pypi.org/project/streamlit-card/
MIT License
116 stars 19 forks source link

Update stCard.tsx #16

Closed OJddJO closed 1 year ago

OJddJO commented 1 year ago

Added ...styles.filter, to give the possibility to modify Filter style

gamcoh commented 1 year ago

Hi,

Could you give an example of what this is?

OJddJO commented 1 year ago

So normally the image of the card is dimmed image image

With ...styles.filter added in /streamlit_card/frontend/src/stCard.tsx, we can add css for the filter in the styles argument

from streamlit_card import card

res = card(
    title="Streamlit Card",
    text="This is a test card",
    image="https://placekitten.com/500/500",
    styles={
        "card": {
            "width": "500px",
            "height": "500px",
            "border-radius": "60px",
            "box-shadow": "0 0 10px rgba(0,0,0,0.5)",
            ...
        },
        "filter": {
            "background-color": "rgba(0, 0, 0, 0)"   <- make the image not dimmed anymore
            ...
        }
    }
)
gamcoh commented 1 year ago

Oh alright great! Could you please add this information to the readme? I'll merge right after

OJddJO commented 1 year ago

Done !