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…UseComponent
Move between the main areas of the app, or to other EBRAINS servicesHeader linkseds-header
Move between pages inside an area with many pages or a hierarchySidebareds-sidebar
See where a deep page sits and go up a levelBreadcrumbeds-breadcrumb
Switch between views of the same thing (overview, settings, history)Tabseds-tabs
Move through a long list of resultsPaginationeds-pagination
Go through an ordered task, one step at a timeStepseds-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 typeSetup
Landing or marketing pageHeader (variant="strong") and footer. No sidebar.
Application with a few areasHeader with 2–5 links, user menu in the header actions.
Application or docs with many pagesHeader, sidebar, breadcrumb above the page title.
Detail page of one recordBreadcrumb back to the list, tabs for the record’s views.

Show where the user is

  • Header: set current: true on the link of the current area.
  • Sidebar: set active-url to 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

DoDon’t
Keep the header the same on every page of the appChange header links per page
Mark the current page in every navigation levelLeave users guessing which item they’re on
Use the sidebar for one area’s pagesRepeat the header links in the sidebar
Keep header actions to two or threeFill the header with buttons