Navigation
The problem: people need to know where they are, what else is there, and how to get back. Navigation that changes from page to page, or that mixes levels, makes an app feel bigger and harder than it is.
The solution: use one component per level of navigation, the same way in every EBRAINS app.
Pick the level
| The user wants to… | Use | Component |
|---|---|---|
| Move between the main areas of the app, or to other EBRAINS services | Header links | eds-header |
| Move between pages inside an area with many pages or a hierarchy | Sidebar | eds-sidebar |
| See where a deep page sits and go up a level | Breadcrumb | eds-breadcrumb |
| Switch between views of the same thing (overview, settings, history) | Tabs | eds-tabs |
| Move through a long list of results | Pagination | eds-pagination |
| Go through an ordered task, one step at a time | Steps | eds-steps-v2 |
Rules of thumb
- Up to about 5 top-level areas fit in the header. More than that, or any nesting: add a sidebar.
- Add breadcrumbs when pages are two or more levels below the top. Not on the home page.
- Tabs change the view, not the page: if a tab would need its own URL in search results, it should be a page.
- Never use tabs for site sections, and never nest tabs.
Common setups
| App type | Setup |
|---|---|
| Landing or marketing page | Header (variant="strong") and footer. No sidebar. |
| Application with a few areas | Header with 2–5 links, user menu in the header actions. |
| Application or docs with many pages | Header, sidebar, breadcrumb above the page title. |
| Detail page of one record | Breadcrumb back to the list, tabs for the record’s views. |
Show where the user is
- Header: set
current: trueon the link of the current area. - Sidebar: set
active-urlto the current path, and open the parent of the current page. - Breadcrumb: the last item has no
url; it is the current page and is announced as such. - Tabs: the active tab must match what is shown, including after a reload (keep it in the URL, for example
?tab=settings).
Small screens
Below 1024px there is no room for a sidebar next to the content.
- Put the sidebar in a drawer, opened by a menu button in the header. Close it when the user picks a page, presses Escape or taps outside it.
- The header moves its links into a slim row under the bar, which scrolls sideways when they don’t fit and keeps the current page in view. Nothing to set up, and no menu to open.
- Hide breadcrumbs if space is tight; the page title and the drawer give enough orientation.
- Tabs scroll sideways when they don’t fit. Keep tab labels to one or two words.
eds-sidebar does not include the drawer. A minimal one in your app:
Writing labels
- Short nouns that say what is there: “Datasets”, “Settings”, not “Click here to manage your datasets”.
- Sentence case, no trailing punctuation.
- The same name everywhere: the header link, the sidebar group, the breadcrumb and the page title use the same words.
Do and don’t
| Do | Don’t |
|---|---|
| Keep the header the same on every page of the app | Change header links per page |
| Mark the current page in every navigation level | Leave users guessing which item they’re on |
| Use the sidebar for one area’s pages | Repeat the header links in the sidebar |
| Keep header actions to two or three | Fill the header with buttons |