BasecoatUI components for htmy.

Card

Example:

Card title

Card content

Card footer


Code example:

from htmy import ComponentType, html

from htmui.basecoat.card import card


def example() -> ComponentType:
    return card(
        html.header(html.h2("Card title")),
        html.section(html.p("Card content")),
        html.footer(html.p("Card footer")),
        class_="w-sm",
    )

Component implementation:

For more details, see the BasecoatUI documentation.

from htmy import ComponentType, PropertyValue, html
from htmy.utils import join

__version__ = "0.1.0"
__framework__ = "BasecoatUI"
__framework_version__ = "0.3"
__framework_url__ = "https://basecoatui.com/components/card/"


def card(*children: ComponentType, class_: str | None = None, **kwargs: PropertyValue) -> ComponentType:
    return html.div(*children, class_=join("card", class_), **kwargs)