Skip to main content

card

Card

from dara.components.common.card import Card

class Card(LayoutComponent)

Card

A card wraps a component instance; giving it an optional title, and/or an optional subtitle. This component has two style options through the accent param. If accent is True, the card has a gradient background. Otherwise the card has a plain background.

A Card component is created via:


from dara.components.common import Card, Stack, Text

Card(
Stack(
Text('Content for the card body'),
),
title='My First card',
subtitle='needs more content',
)

Arguments:

  • subtitle: The subtitle of the card
  • title: The title of the card
  • accent: Boolean containing whether the styling should be filled with the accent gradient or plain, by default this is False.
  • justify: How to justify the content of the card, accepts any flexbox justifications
  • align: How to align the content of the card, accepts any flexbox alignments

Attributes

  • subtitle: Optional[Union[str, NonDataVariable]]
  • title: Optional[Union[str, NonDataVariable]]
  • accent: bool