Card
A card combines a title, subtitle, content and actions into a single unit.
@solara.component
def Card(
title: Optional[str] = None,
subtitle: Optional[str] = None,
elevation: int = 2,
margin=2,
children: List[solara.Element] = [],
classes: List[str] = [],
style: Union[str, Dict[str, str], None] = None,
):
...
Example
import solara
@solara.component
def Page():
with solara.Card(title="Card title", subtitle="Card subtitle"):
solara.Markdown(
"Lorem ipsum dolor sit amet consectetur adipisicing elit. "\
"Commodi, ratione debitis quis est labore voluptatibus! "\
"Eaque cupiditate minima, at placeat totam, magni doloremque "\
"veniam neque porro libero rerum unde voluptatem!"
)
with solara.CardActions():
solara.Button("Action 1", text=True)
solara.Button("Action 2", text=True)
Card title
Card subtitle
Lorem ipsum dolor sit amet consectetur adipisicing elit. Commodi, ratione debitis quis est labore voluptatibus! Eaque cupiditate minima, at placeat totam, magni doloremque veniam neque porro libero rerum unde voluptatem!
Live output
Arguments
title
: Title of the card.subtitle
: Subtitle of the card.elevation
: Elevation of the card, gives the appearance of hovering above the page.margin
: Margin of the card.children
: Children are placed as the main content of the card.style
: CSS style to apply to the top level element.