Main
Main
and Mains
may come in handy to configure Header tabs
via HTML.
The Main
component is a fairly unassuming part of the
basic layout
where it functions to control the flex
. Here it is, stuck between
the App
and Content
.
We can add multiple Main
elements inside a containing
Mains
to automatically generate top level tabs in the Header. They
must be fitted with a label
.
The tabs will automatically be updated when you remove or append further
Main
elements, just as long as you remember to set the
label
attribute.
Top level tabs may alternatively be configured via the Header API.
Tab selection
You can set the default selection with the
selected
attribute.
You can track tab selection with the inline event listener
onselect
.
You can of course still also manage tabs via the
Header API, just
remember that tabs added this way will not inject the corresponding
Main
element, so you must figure out an alternative way of showing
the appropriate content when onselect
happens.