Tabs


Tabs in ESP-DASH Pro allow you to create multiple pages to organize and sort your various widgets (cards & charts). This feature comes particularly useful when there are all a lot of widgets.
By default, ESP-DASH puts everything into ‘Overview’ Tab.
If every card or chart is assigned a custom tab, then the dashboard will intelligently hide the overview tab from sidebar.
Create Tab
Initializer should be kept in global scope. ( ie. outside of any function in your sketch )
dash::Tab tab1(dashboard, "Custom Tab 1", dash::Icon::COG_ICON);
As of v5, you can assign a icon to the tab using dash::Icon
enum. This icon will be displayed in the sidebar next to the tab name. Here are the available icons:
Icon | Value |
---|---|
None (default) |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
Set Tab
Once a tab has been created, you need to set the tab for relevant cards and charts using setTab
function of Card or Chart class. setTab
accepts a pointer to the tab which we just created.
card1.setTab(tab1);
chart1.setTab(tab1);