gamcoh / st-card

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

Added a way to use a percentage as width parameter for card CSS #20

Closed OJddJO closed 1 year ago

OJddJO commented 1 year ago

Allow the CSS of the card to use a percentage as width parameter and so, be able to "add a way" to do use_column_width=True (https://github.com/gamcoh/st-card/issues/19) like here:

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": "100%", # <- make the card use the width of its container, note that it will not resize the height of the card automatically
            "height": "300px" # <- if you want to set the card height to 300px
            ...
        }
    }
)

Also change the animation and split the CSS of the text and the title.