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.

activate()

Called when activating the page this section belongs to. Assigns unique IDs to everything in the section.

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 flows.

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.

get_card_by_id(card_id)
Return type:

Card

to_json()
Return type:

dict