inkBoard inkBoard inkBoard
  • Tutorial
    • Cheatsheet A quick reference for core concepts
  • Documentation
    • Configuration
    • Elements
    • Platforms
    • Integrations
/

Documentation

  • Documentation
  • Types
  • Configuration
  • Elements
    • Button
    • Picture & Icon
    • Tile
    • Sliders
    • CheckBoxes
    • Clocks
    • Counter
    • Dropdown
    • Layouts
    • Popups
    • Menu Elements
    • Device Elements
    • Base Elements
  • Platforms
    • Desktop
      • Desktop
      • Readme
    • Kobo
      • Kobo
      • Readme
    • Developing
  • Integrations
    • Home Assistant
      • Elements
      • Examples
    • Meteocons
    • System Tray
    • Developing
  • Designer
  • Command Line

On this page

  • StatusBar
  • DeviceMenu
  • ScreenMenu
Slalamander/inkBoard 0 0
  1. inkBoard /
  2. Site Index /
  3. Elements /
  4. Menu Elements

Menu Elements¶

Out of the box, inkBoard provides a few menus. The StatusBar is the most prevalent one, as it the main way to actually access the other menus. The idea of these menus is that they can be accessed via an icon in the statusbar. The menus itself are limited to a single instance, meaning they do not need to be instantiated. Styling can be done via the element_properties in the statusbar.

class StatusBar¶

A StatusBar to show the status of your dashboard and various other things.

The added elements are the same for all instances, but which ones are shown can be configured via the hide parameter.

Available shorthand actions are:
  • generate: Generates the element’s image data.

  • update: Function to update an element via actions.

Element Properties

property accent_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None
Accent color to style child elements. Not inherently used in the layout itself, but can be used in child elements, to give them a uniform style Set a color_property of one to “accent” to do so.
Optional, defaults to "gray"
property background_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None
Color of the element background.
Optional, defaults to None
property foreground_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None
Foreground color to style child elements Additional color property for Layouts. Not inherently used in the layout itself, but can be used in child elements, to give them a uniform style. Set a color_property of one to “foreground” to do so.
Optional, defaults to "black"
property outline_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None
Color of the layout’s outline. Set to None to use no outline.
Optional, defaults to None
property hold_action: str | Callable[[Element, InteractEvent, Any], Any] | None
The function called when the element is held. Set to None to have nothing called. If set to a dict, the values for hold_action_data and hold_action_map will be overwritten if the respective key is present.
Optional, defaults to None
property hold_release_action: str | Callable[[Element, InteractEvent, Any], Any] | None
The function called when the element is released from being held down. This function is only available on devices with the HOLD_RELEASE feature. Set to None to have nothing called. If set to a dict, the values for hold_release_action_data and hold_release_action_map will be overwritten if the respective key is present.
Optional, defaults to None
property tap_action: str | Callable[[Element, InteractEvent, Any], Any] | None
The function called when the element is tapped. Set to None to have nothing called. If set to a dict, the values for tap_action_data and tap_action_map will be overwritten if the respective key is present.
Optional, defaults to None
property element_properties
Allows for styling the elements individually, similar to how it is done for Tile Elements. Accepts all the elements registered as a statusbar element, as well as ‘clock’ (for the clock element).
Optional, defaults to {}
property feedback_duration: duration
Duration of the element’s feedback function The time an element will stay in ‘feedback state’, before returning to its normal state. Can be set to a string, which will be parsed to the right amount of seconds.
Optional, defaults to 0.75
property inner_margins: tuple[str | int | float, str | int | float, str | int | float, str | int | float]
The values of the inner margins, parsed to a 4 tuple (i.e. the (top,right,bottom,left) margins respectively).
Optional, defaults to [0, 5]
property orientation: Literal['horizontal', 'vertical']
The orientation of the slider. Horizontal or Vertical. When changed after initialising, this does change the clock’s orientation along with it, but not the text alignment of the clock.
Optional, defaults to "horizontal"
property outer_margins: tuple[str | int | float, str | int | float, str | int | float, str | int | float]
The values of the outer margins, parsed to a 4 tuple (i.e. the (top,right,bottom,left) margins respectively).
Optional, defaults to [0, 10]
property outline_width: str | int | float
Width of the outline of the encompassing rectangle.
Optional, defaults to 0
property radius: str | int | float
Corner radius of the outlining rectangle.
Optional, defaults to 0
property status_element_properties
Allows for general styling of the statusbar icons, i.e. any value passed here is applied to all statusbar elements (except the clock).
Optional, defaults to {'background_shape': 'circle', 'background_color': 'white'}
property accent_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None

Optional, defaults to "gray"

property background_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None

Optional, defaults to None

property foreground_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None

Optional, defaults to "black"

property outline_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None

Optional, defaults to None

property hold_action: str | Callable[[Element, InteractEvent, Any], Any] | None

Optional, defaults to None

property hold_release_action: str | Callable[[Element, InteractEvent, Any], Any] | None

Optional, defaults to None

property tap_action: str | Callable[[Element, InteractEvent, Any], Any] | None

Optional, defaults to None

property element_properties

Optional, defaults to {}

property feedback_duration: duration

Optional, defaults to 0.75

property inner_margins: tuple[str | int | float, str | int | float, str | int | float, str | int | float]

Optional, defaults to [0, 5]

property orientation: Literal['horizontal', 'vertical']

Optional, defaults to "horizontal"

property outer_margins: tuple[str | int | float, str | int | float, str | int | float, str | int | float]

Optional, defaults to [0, 10]

property outline_width: str | int | float

Optional, defaults to 0

property radius: str | int | float

Optional, defaults to 0

property status_element_properties

Optional, defaults to {'background_shape': 'circle', 'background_color': 'white'}

  • accent_color, Optional, defaults to "gray". Accent color to style child elements.

  • background_color, Optional, defaults to None. Color of the element background.

  • foreground_color, Optional, defaults to "black". Foreground color to style child elements

  • outline_color, Optional, defaults to None. Color of the layout’s outline.

  • hold_action, Optional, defaults to None. The function called when the element is held.

  • hold_release_action, Optional, defaults to None. The function called when the element is released from being held down.

  • tap_action, Optional, defaults to None. The function called when the element is tapped.

  • element_properties, Optional, defaults to {}. Allows for styling the elements individually, similar to how it is done for Tile Elements.

  • feedback_duration, Optional, defaults to 0.75. Duration of the element’s feedback function

  • inner_margins, Optional, defaults to [0, 5]. The values of the inner margins, parsed to a 4 tuple (i.e. the (top,right,bottom,left) margins respectively)

  • orientation, Optional, defaults to "horizontal". The orientation of the slider. Horizontal or Vertical.

  • outer_margins, Optional, defaults to [0, 10]. The values of the outer margins, parsed to a 4 tuple (i.e. the (top,right,bottom,left) margins respectively)

  • outline_width, Optional, defaults to 0. Width of the outline of the encompassing rectangle

  • radius, Optional, defaults to 0. Corner radius of the outlining rectangle

  • status_element_properties, Optional, defaults to {'background_shape': 'circle', 'background_color': 'white'}. Allows for general styling of the statusbar icons, i.e. any value passed here is applied to all statusbar elements (except the clock)

class DeviceMenu¶

The menu for the device connected to the screen.

It can be accessed and shown via its id device-menu.

Available shorthand actions are:
  • generate: Generates the element’s image data.

  • update: Function to update an element via actions.

  • show-popup: Shows the popup on screen

  • close-popup: Removes the popup from the screen

Element Properties

property accent_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None
Accent color to style child elements. Not inherently used in the layout itself, but can be used in child elements, to give them a uniform style Set a color_property of one to “accent” to do so.
Optional, defaults to "gray"
property background_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None
Color of the element background.
Optional, defaults to "white"
property close_icon_color
Color of the closing icon.
Optional, defaults to "white"
property foreground_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None
Foreground color to style child elements Additional color property for Layouts. Not inherently used in the layout itself, but can be used in child elements, to give them a uniform style. Set a color_property of one to “foreground” to do so.
Optional, defaults to "black"
property header_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]
Color of the header bar.
Optional, defaults to "steelblue"
property outline_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None
Color of the layout’s outline. Set to None to use no outline.
Optional, defaults to None
property title_color
Color of the title text.
Optional, defaults to "white"
property hold_action: str | Callable[[Element, InteractEvent, Any], Any] | None
The function called when the element is held. Set to None to have nothing called. If set to a dict, the values for hold_action_data and hold_action_map will be overwritten if the respective key is present.
Optional, defaults to None
property hold_release_action: str | Callable[[Element, InteractEvent, Any], Any] | None
The function called when the element is released from being held down. This function is only available on devices with the HOLD_RELEASE feature. Set to None to have nothing called. If set to a dict, the values for hold_release_action_data and hold_release_action_map will be overwritten if the respective key is present.
Optional, defaults to None
property auto_close: duration
The time with no interaction after which this popup is automatically closed. Set to False to disable. If True, it will use the default value of the screen instance.
Optional, defaults to True
property blur_background: bool
Blurs the dashboards behind the popup when it is shown. If true, when adding the popup to the screen, the background around it is blurred.
Optional, defaults to True
property close_icon: str
The mdi icon to use for the button that closes the popup.
Optional, defaults to "mdi:close-thick"
property feedback_duration: duration
Duration of the element’s feedback function The time an element will stay in ‘feedback state’, before returning to its normal state. Can be set to a string, which will be parsed to the right amount of seconds.
Optional, defaults to 0.75
property height: str | int | float
The height of the popup.
Optional, defaults to "H*0.5"
property horizontal_position: str | int | float
x Postion off the popup’s upper left corner.
Optional, defaults to "(W-w)/2"
property layout: list[str | int | float, tuple[Element, str | int | float]]
The layout list.
Optional, defaults to []
property outline_width: str | int | float
Width of the outline of the encompassing rectangle.
Optional, defaults to 5
property radius: str | int | float
Corner radius of the outlining rectangle.
Optional, defaults to "H*0.05"
property title_font: str
The font used for the popup title.
Optional, defaults to "header"
property vertical_position: str | int | float
y Position of the popups upper left corner.
Optional, defaults to "(H-h)/2"
property width: str | int | float
The width of the popup.
Optional, defaults to "W*0.8"
property accent_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None

Optional, defaults to "gray"

property background_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None

Optional, defaults to "white"

property close_icon_color

Optional, defaults to "white"

property foreground_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None

Optional, defaults to "black"

property header_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]

Optional, defaults to "steelblue"

property outline_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None

Optional, defaults to None

property title_color

Optional, defaults to "white"

property hold_action: str | Callable[[Element, InteractEvent, Any], Any] | None

Optional, defaults to None

property hold_release_action: str | Callable[[Element, InteractEvent, Any], Any] | None

Optional, defaults to None

property auto_close: duration

Optional, defaults to True

property blur_background: bool

Optional, defaults to True

property close_icon: str

Optional, defaults to "mdi:close-thick"

property feedback_duration: duration

Optional, defaults to 0.75

property height: str | int | float

Optional, defaults to "H*0.5"

property horizontal_position: str | int | float

Optional, defaults to "(W-w)/2"

property layout: list[str | int | float, tuple[Element, str | int | float]]

Optional, defaults to []

property outline_width: str | int | float

Optional, defaults to 5

property radius: str | int | float

Optional, defaults to "H*0.05"

property title_font: str

Optional, defaults to "header"

property vertical_position: str | int | float

Optional, defaults to "(H-h)/2"

property width: str | int | float

Optional, defaults to "W*0.8"

  • accent_color, Optional, defaults to "gray". Accent color to style child elements.

  • background_color, Optional, defaults to "white". Color of the element background.

  • close_icon_color, Optional, defaults to "white". Color of the closing icon

  • foreground_color, Optional, defaults to "black". Foreground color to style child elements

  • header_color, Optional, defaults to "steelblue". Color of the header bar

  • outline_color, Optional, defaults to None. Color of the layout’s outline.

  • title_color, Optional, defaults to "white". Color of the title text

  • hold_action, Optional, defaults to None. The function called when the element is held.

  • hold_release_action, Optional, defaults to None. The function called when the element is released from being held down.

  • auto_close, Optional, defaults to True. The time with no interaction after which this popup is automatically closed.

  • blur_background, Optional, defaults to True. Blurs the dashboards behind the popup when it is shown.

  • close_icon, Optional, defaults to "mdi:close-thick". The mdi icon to use for the button that closes the popup

  • feedback_duration, Optional, defaults to 0.75. Duration of the element’s feedback function

  • height, Optional, defaults to "H*0.5". The height of the popup

  • horizontal_position, Optional, defaults to "(W-w)/2". x Postion off the popup’s upper left corner.

  • layout, Optional, defaults to []. The layout list

  • outline_width, Optional, defaults to 5. Width of the outline of the encompassing rectangle

  • radius, Optional, defaults to "H*0.05". Corner radius of the outlining rectangle

  • title_font, Optional, defaults to "header". The font used for the popup title

  • vertical_position, Optional, defaults to "(H-h)/2". y Position of the popups upper left corner

  • width, Optional, defaults to "W*0.8". The width of the popup

class ScreenMenu¶

Popup Menu to control and set various settings for the screen.

It can be accessed via the popup_id screen-menu.

Available shorthand actions are:
  • generate: Generates the element’s image data.

  • update: Function to update an element via actions.

  • show-popup: Shows the popup on screen

  • close-popup: Removes the popup from the screen

Element Properties

property accent_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None
Accent color to style child elements. Not inherently used in the layout itself, but can be used in child elements, to give them a uniform style Set a color_property of one to “accent” to do so.
Optional, defaults to "gray"
property background_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None
Color of the element background.
Optional, defaults to "white"
property close_icon_color
Color of the closing icon.
Optional, defaults to "white"
property foreground_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None
Foreground color to style child elements Additional color property for Layouts. Not inherently used in the layout itself, but can be used in child elements, to give them a uniform style. Set a color_property of one to “foreground” to do so.
Optional, defaults to "black"
property header_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]
Color of the header bar.
Optional, defaults to "steelblue"
property outline_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None
Color of the layout’s outline. Set to None to use no outline.
Optional, defaults to None
property title_color
Color of the title text.
Optional, defaults to "white"
property hold_action: str | Callable[[Element, InteractEvent, Any], Any] | None
The function called when the element is held. Set to None to have nothing called. If set to a dict, the values for hold_action_data and hold_action_map will be overwritten if the respective key is present.
Optional, defaults to None
property hold_release_action: str | Callable[[Element, InteractEvent, Any], Any] | None
The function called when the element is released from being held down. This function is only available on devices with the HOLD_RELEASE feature. Set to None to have nothing called. If set to a dict, the values for hold_release_action_data and hold_release_action_map will be overwritten if the respective key is present.
Optional, defaults to None
property auto_close: duration
The time with no interaction after which this popup is automatically closed. Set to False to disable. If True, it will use the default value of the screen instance.
Optional, defaults to True
property blur_background: bool
Blurs the dashboards behind the popup when it is shown. If true, when adding the popup to the screen, the background around it is blurred.
Optional, defaults to True
property close_icon: str
The mdi icon to use for the button that closes the popup.
Optional, defaults to "mdi:close-thick"
property feedback_duration: duration
Duration of the element’s feedback function The time an element will stay in ‘feedback state’, before returning to its normal state. Can be set to a string, which will be parsed to the right amount of seconds.
Optional, defaults to 0.75
property height: str | int | float
The height of the popup.
Optional, defaults to "H*0.5"
property horizontal_position: str | int | float
x Postion off the popup’s upper left corner.
Optional, defaults to "(W-w)/2"
property layout: list[str | int | float, tuple[Element, str | int | float]]
The layout list.
Optional, defaults to []
property outline_width: str | int | float
Width of the outline of the encompassing rectangle.
Optional, defaults to 5
property radius: str | int | float
Corner radius of the outlining rectangle.
Optional, defaults to "H*0.05"
property title_font: str
The font used for the popup title.
Optional, defaults to "header"
property vertical_position: str | int | float
y Position of the popups upper left corner.
Optional, defaults to "(H-h)/2"
property width: str | int | float
The width of the popup.
Optional, defaults to "W*0.8"
property accent_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None

Optional, defaults to "gray"

property background_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None

Optional, defaults to "white"

property close_icon_color

Optional, defaults to "white"

property foreground_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None

Optional, defaults to "black"

property header_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A]

Optional, defaults to "steelblue"

property outline_color: str | int | list | tuple[L, A] | tuple[R, G, B] | tuple[R, G, B, A] | None

Optional, defaults to None

property title_color

Optional, defaults to "white"

property hold_action: str | Callable[[Element, InteractEvent, Any], Any] | None

Optional, defaults to None

property hold_release_action: str | Callable[[Element, InteractEvent, Any], Any] | None

Optional, defaults to None

property auto_close: duration

Optional, defaults to True

property blur_background: bool

Optional, defaults to True

property close_icon: str

Optional, defaults to "mdi:close-thick"

property feedback_duration: duration

Optional, defaults to 0.75

property height: str | int | float

Optional, defaults to "H*0.5"

property horizontal_position: str | int | float

Optional, defaults to "(W-w)/2"

property layout: list[str | int | float, tuple[Element, str | int | float]]

Optional, defaults to []

property outline_width: str | int | float

Optional, defaults to 5

property radius: str | int | float

Optional, defaults to "H*0.05"

property title_font: str

Optional, defaults to "header"

property vertical_position: str | int | float

Optional, defaults to "(H-h)/2"

property width: str | int | float

Optional, defaults to "W*0.8"

  • accent_color, Optional, defaults to "gray". Accent color to style child elements.

  • background_color, Optional, defaults to "white". Color of the element background.

  • close_icon_color, Optional, defaults to "white". Color of the closing icon

  • foreground_color, Optional, defaults to "black". Foreground color to style child elements

  • header_color, Optional, defaults to "steelblue". Color of the header bar

  • outline_color, Optional, defaults to None. Color of the layout’s outline.

  • title_color, Optional, defaults to "white". Color of the title text

  • hold_action, Optional, defaults to None. The function called when the element is held.

  • hold_release_action, Optional, defaults to None. The function called when the element is released from being held down.

  • auto_close, Optional, defaults to True. The time with no interaction after which this popup is automatically closed.

  • blur_background, Optional, defaults to True. Blurs the dashboards behind the popup when it is shown.

  • close_icon, Optional, defaults to "mdi:close-thick". The mdi icon to use for the button that closes the popup

  • feedback_duration, Optional, defaults to 0.75. Duration of the element’s feedback function

  • height, Optional, defaults to "H*0.5". The height of the popup

  • horizontal_position, Optional, defaults to "(W-w)/2". x Postion off the popup’s upper left corner.

  • layout, Optional, defaults to []. The layout list

  • outline_width, Optional, defaults to 5. Width of the outline of the encompassing rectangle

  • radius, Optional, defaults to "H*0.05". Corner radius of the outlining rectangle

  • title_font, Optional, defaults to "header". The font used for the popup title

  • vertical_position, Optional, defaults to "(H-h)/2". y Position of the popups upper left corner

  • width, Optional, defaults to "W*0.8". The width of the popup

Previous
Popups
Next
Device Elements

2024, Slalamander

Made with Sphinx and Shibuya theme.