section¶
- class virtualitics_sdk.page.section.Section(title, content, subtitle='', description='', _id=None, show_title=True, show_description=True)¶
Bases:
object
A divider of the Page. A container for cards. A Page can have multiple Sections.
- Parameters:
title (
str
) – The title of the Section.content (
List
[Card
]) – The cards inside of this Section.subtitle (
str
) – The subtitle of the Section, defaults to “”.description (
str
) – The description for the Section, defaults to “”._id (
str
) – ID of the section. Defaults to autogenerated UUID.
EXAMPLE:
# Imports from virtualitics_sdk.page.card import Card from virtualitics_sdk.page.section import Section . . . # Example usage class ExStep(Step): def run(self, flow_metadata): . . . ex_card = Card(title="Example Card", content=[example_content]) ex_section = Section(Here's the card!", [ex_card])
- add_card_w_content(elems, card_title='', card_subtitle='', card_description='', card_id='', show_card_title=True, show_card_description=True, page_update=None)¶
Adds a new card containing the content specified. It’s recommended you use the method in the
Page
class instead when writing apps.- Parameters:
elems (
Union
[Element
,List
[Element
],List
[Row
]]) – The elements to be added. Can be a list or single element.card_title (
str
) – The title of the new card, defaults to ‘’.card_subtitle (
str
) – The subtitle for the new card, defaults to ‘’.card_description (
str
) – The description for the new card, defaults to ‘’.card_id – The ID of the card to add, defaults to “”.
show_card_title (
bool
) – whether to show the title of the card on the page when rendered, defaults to True.show_card_description (
bool
) – whether to show the description of the card to the page when rendered, defaults to True.page_update (
Optional
[Callable
]) – The page update function for the new card, defaults to None.
- to_json()¶
- Return type:
dict