Anniversary Sale · up to 80% off all librariesEnds Nov 9Shop now
SOFTTDocs

Tabs

Organize ESP-DASH Pro dashboards into multiple pages with tabs, each with an optional sidebar icon.

ESP-DASH Pro feature. This functionality is available only in the commercial edition of ESP-DASH.

Tabs split the dashboard into multiple pages so that you can group related widgets. They are useful when a dashboard contains a large number of cards and charts.

Tabs in the dashboard sidebar

By default, ESP-DASH places all widgets in the Overview tab.

If every card and chart is assigned to a custom tab, the dashboard hides the Overview tab from the sidebar.

Constructor

Declare tabs in global scope, outside of any function.

dash::Tab tab1(dashboard, "Custom Tab 1", dash::Icon::COG_ICON);

Prop

Type

Icons

Since v5, you can assign an icon to a tab with the dash::Icon enum. The icon is displayed in the sidebar next to the tab name.

ValueIcon
UNASSIGNED_ICONNone (default)
HOME_ICONHome
COG_ICONCog
SUN_ICONSun
MOON_ICONMoon
SUN_MOON_ICONSun and moon
DATABASE_ICONDatabase
COMPUTER_ICONComputer
ACTIVITY_ICONActivity
ALARM_ICONAlarm clock
AUDIO_ICONAudio waveform
JOYSTICK_ICONJoystick

Assign a widget to a tab

After you create a tab, assign cards and charts to it with their setTab() method. setTab() takes a reference to the tab.

card1.setTab(tab1);
chart1.setTab(tab1);

To move a widget back to the Overview tab, call removeTab():

card1.removeTab();

Both methods return true if the assignment changed and false otherwise.

On this page