eds-header
Explore the Interactive Component
Use the playground below to experiment with the component. Click the button to view the full Storybook deployment for additional examples and configurations.
See It in Use with Code
Check out the practical implementations of component.
Passing Links as a JSON String (Plain HTML)
When you’re using the component directly in HTML (or in frameworks that don’t support property binding), you must pass the links as a JSON string:
Here the links attribute is a string. Your getter will parse it into an array of objects.
Use the product prop to show a product name beside the EBRAINS mark, and the actions slot for right-aligned controls:
Passing Links as an Object (Using Property Binding)
In frameworks like React or Angular, you can take advantage of property binding to pass the links directly as an object:
In React
In Angular
In Angular, you would bind the property using square brackets:
And in your Angular component:
In Vue
One way is to explicitly pass a JSON string from your Vue component:
Variants
variant | Look | Use for |
|---|---|---|
default | Page surface (white; dark under the dark theme) with a fine bottom divider | Standard pages |
inverse | Always white, with a fine bottom divider | Content-heavy pages on any theme |
strong | Brand black, light text, neon accents | Landing pages, branded sections |
Mark the active section with current: true on its link object: it gets aria-current="page" and an underline. Keep the actions slot to two or three controls.
Small Screens
Below 1024px (iPads and phones) the links leave the bar and show in a slim row under it. The row scrolls sideways when the links don’t fit, fades the edge that has more, and keeps the current page in view. The logo and the actions slot stay in the bar. There is no menu to open and nothing for the app to wire up.
The old menu burger prop is deprecated: it needed a separate menu component and is no longer needed.
Overview
EdsHeader is a header component designed for the EBRAINS platform.
It provides a customizable and responsive navigation experience, tailored for both desktop and mobile views.
Key Features:
- Logo Link: Includes a logo that links to the homepage or a specified URL.
- Primary Navigation: Displays an array of navigation links for core platform sections.
- User Authentication Integration: Supports Keycloak for login and logout, displaying user authentication options when enabled.
- Mobile-Friendly Menu: Offers a collapsible mobile menu with additional links, enhancing navigation for smaller screens.
- Event-Driven Menu Toggle: Emits a toggle event to handle opening and closing of a fullscreen menu in sync with other components.
This component is well-suited for creating a unified header across the platform with seamless integration of navigation, authentication, and responsive design elements.
Properties
| Property | Attribute | Description | Type | Default |
|---|---|---|---|---|
links | links | JSON string representing the links for primary navigation. Each link should include label, url, and optionally an icon, external, and current (marks the active section: aria-current=“page”). | string | { label: string; url: string; icon?: string; external?: boolean; current?: boolean; }[] | undefined |
menu | menu | [DEPRECATED] Below 1024px the links now show in a scrollable row under the bar, so no menu is needed. This burger only emits toggleheadermenu and needs the app to wire up a separate menu; it will be removed in the next major release. | boolean | false |
product | product | Optional product name set beside the EBRAINS mark (“EBRAINS | Ready”). Passed to eds-logo; empty keeps the plain mark. | string | undefined |
productShort | product-short | Optional shorter product name for phones; passed to eds-logo. | string | undefined |
url | url | URL for the home logo link. This is the default URL that the logo points to. | string | '/' |
variant | variant | Header style variant: determines text and background colors. - “default”: the page surface (white in light, brand black in the dark theme) with a fine bottom divider - “inverse”: always white, with a fine bottom divider - “strong”: brand black with white text | "default" | "inverse" | "strong" | 'default' |
Events
| Event | Description | Type |
|---|---|---|
toggleheadermenu | Event to signal toggle menu action | CustomEvent<boolean> |
Dependencies
Depends on
Graph
graph TD; eds-header --> eds-link eds-header --> eds-logo eds-header --> eds-button eds-link --> eds-icon-wrapper eds-button --> eds-icon-wrapper style eds-header fill:#f9f,stroke:#333,stroke-width:4px
Built with StencilJS