sepal_ui.sepalwidgets.app.DrawerItem#

class sepal_ui.sepalwidgets.app.DrawerItem(**kwargs)[source]#

Custom DrawerItem using the user input.

If a card is set the drawerItem will trigger the display of all the Tiles in the app that have the same mount_id. If an href is set, the drawer will open the link in a new tab.

Parameters:
  • title (str) – the title of the drawer item

  • icon (str) – the full name of a mdi/fa icon

  • card (str) – the mount_id of tiles in the app

  • href (str) – the absolute link to an external web page

  • model (Model | None) – sepalwidget model where is defined the bin_var trait

  • bind_var (str) – required when model is selected. Trait to link with ‘alert’ self trait parameter

  • kwargs (optional) – any parameter from a v.ListItem. If set, ‘_metadata’, ‘target’, ‘link’ and ‘children’ will be overwritten.

Attributes

add_notif

alert

Trait to control visibility of an alert in the drawer item

alert_badge

red circle to display in the drawer

rt

The trigger to resize maps and other javascript object when jumping from a tile to another

tiles

the cards of the application

Methods

__init__

Custom DrawerItem using the user input.

display_tile

Display the appropriate tiles when the item is clicked.

remove_notif

Remove notification alert.

DrawerItem.__init__(title, icon='', card='', href='', model=None, bind_var='', **kwargs)[source]#

Custom DrawerItem using the user input.

If a card is set the drawerItem will trigger the display of all the Tiles in the app that have the same mount_id. If an href is set, the drawer will open the link in a new tab.

Parameters:
  • title (str) – the title of the drawer item

  • icon (str) – the full name of a mdi/fa icon

  • card (str) – the mount_id of tiles in the app

  • href (str) – the absolute link to an external web page

  • model (Model | None) – sepalwidget model where is defined the bin_var trait

  • bind_var (str) – required when model is selected. Trait to link with ‘alert’ self trait parameter

  • kwargs (optional) – any parameter from a v.ListItem. If set, ‘_metadata’, ‘target’, ‘link’ and ‘children’ will be overwritten.

Return type:

None

DrawerItem.display_tile(tiles)[source]#

Display the appropriate tiles when the item is clicked.

The tile to display will be all tile in the list with the mount_id as the current object.

Parameters:

tiles (List[Card]) – the list of all the available tiles in the app

Return type:

Self

DrawerItem.remove_notif()[source]#

Remove notification alert.

Return type:

None