gamcoh / st-card

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

How to customize space around card? #40

Closed YojanaGadiya closed 1 day ago

YojanaGadiya commented 2 days 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 day 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