utils
ItemBadge
from dara.components.common.utils import ItemBadge
class ItemBadge(BaseModel)
Add a badge to an item in a list
Attributes
- color: Optional[str]
- label: str
Item
from dara.components.common.utils import Item
class Item(BaseModel)
A class for serializing a list of options for the select to show
Attributes
- badge: Optional[ItemBadge]
- image: Optional[str]
- label: str
- value: Union[str, int, float, BaseModel]
Methods
to_item
@staticmethod
def to_item(item: Any) -> 'Item'
Take whatever value was passed in and create an item out of it, or raise an error if not possible.
Arguments:
item
: the item to parse
CarouselItem
from dara.components.common.utils import CarouselItem
class CarouselItem(BaseModel)
CarouselItem provides with the following props:
Arguments:
title
: An optional string titlesubtitle
: An optional string subtitlecomponent
: An optional Dara component to render in the Carouselimage
: An optional image url for the Carousel item to displayimage_alt
: The alt text for that imageimage_height
: Optional string containing the height the image should takeimage_width
: Optional string containing the width the image should take
Attributes
- title: Optional[str]
- subtitle: Optional[str]
- component: Optional[ComponentInstanceType]
- image: Optional[str]
- image_alt: Optional[str]
- image_height: Optional[str]
- image_width: Optional[str]
Methods
to_item
@staticmethod
def to_item(item: Any) -> 'CarouselItem'
Take whatever value was passed in and create an item out of it, or raise an error if not possible.
Arguments:
item
: the item to parse