eds-sidebar

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.

eds-sidebar Open in Storybook

See It in Use with Code

Check out the practical implementations of component.

Passing Items 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 items as a JSON string:

Passing Items as an Object (Using Property Binding)

In frameworks like React or Angular, you can take advantage of property binding to pass the items directly as an object:

In React

In Vue

Themes

themeLook
defaultStandard sidebar
ebrainsEBRAINS-branded sidebar
minimalMinimal, lightweight appearance

Items take id, title, url, children, open and active (no icons). Set active-url to highlight the current page. The sidebar does not hide itself on small screens: put it in a drawer that a menu button opens (see the Navigation pattern).

Properties

PropertyAttributeDescriptionTypeDefault
activeUrlactive-urlCurrent active URL for routingstring''
enableRoutingenable-routingEnable/disable routing behaviorbooleantrue
itemsitemsSidebar items data structure Can be passed as JSON string in HTML or as object via JavaScriptSidebarItem[] | string'[]'
maxLevelmax-levelMaximum nesting level to displaynumber4
themethemeTheme variant: ‘default’ or ‘minimal’"default" | "ebrains" | "minimal"'default'

Events

EventDescriptionType
sidebarEvent emitted when the routing is changed.CustomEvent<string>

Dependencies

Depends on

Graph

graph TD;
  eds-sidebar --> eds-icon-wrapper
  style eds-sidebar fill:#f9f,stroke:#333,stroke-width:4px

Built with StencilJS