gamcoh / st-card

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

How to customize space around card? #40

Closed YojanaGadiya closed 1 month ago

YojanaGadiya commented 1 month ago

Dear @gamcoh ,

I am wondering if there is a way to customize the space around the card using CSS. If yes, please could you let me know the best way to do it?

Regards, Yojana Gadiya

gamcoh commented 1 month ago

Hi, you could use margins like so:

from streamlit_card import card

res = card(
    title="Streamlit Card",
    text="This is a test card",
    image="https://placekitten.com/500/500",
    styles={
        "card": {
            "margin": "40px", <-- margin around the card
            ...
        },
        ...
    }
)

Learn more here