Panels
Featured prominently in Asides, the Panel is simply a container with a scrollbar. But Panels can also be used to generate entire page layouts — such as this one.
We can position Panel elements as direct children of the body to autogenerate tabs in the TopBar. The tabs at the top of this page are created with the markup shown below.
<body>
<header data-ts="TopBar"></header>
<div data-ts="Panel" data-ts.label="Panel One">
<main data-ts="Main">
<div data-ts="MainContent">…</div>
</main>
</div>
<div data-ts="Panel" data-ts.label="Panel Two">
<main data-ts="Main">
<div data-ts="MainContent">…</div>
</main>
</div>
<div data-ts="Panel" data-ts.label="Panel Three">
<main data-ts="Main">
<div data-ts="MainContent">…</div>
</main>
</div>
</body>
Note that the content of the three "pages" are each wrapped inside a nested Main element. It is possible to nest further Panel elements inside these Main elements to generate additional TabBars as seen in Panel Two.
When to use this?
Certainly when you are prototyping as a UX designer, but it will otherwise depend on your technology stack (since this may not a good fit for all frameworks) and on your requirements. If you app features highly dynamic navigation, it may be easier to approach this kind of multi-page layout programatically instead of declaratively.
History support
To avoid conflicts with your favorite routing library, Tradeshift UI will not attempt to update the history (via the address bar). You can however add history support if you manually intercept tab selection like this.
ts.ui.TopBar.tabs().onselect = function(newindex, oldindex) {
// update history here
};