Masthead navigation - carbon-design-system/carbon-for-ibm-dotcom-website GitHub Wiki
CoreUI component
Masthead navigation is an optional component of the Masthead component. If enabled, they allow users to more easily navigate to key areas of the site regardless of the page they are currently on.
This overflow helps when content becomes greater than what the design at that view can handle. It allows customers to continue to interact with the navigation items within a limited amount of space.
2.1. Container
The navigation container has a contained width depending on the browser’s window size, and allows content to overflow.
Events
name
description
2.1.1
to next
Transitions to the next section/panel/view of nav content on the right and focus the first item.
2.1.2
to previous
Transitions to previous section/panel/view of nav content on the left and focus the last item.
2.1.3
swipe left
Triggers to next event 2.1.1
2.1.4
swipe right
Triggers to previous event 2.1.2
Logic
condition
description
2.1.5
onload && selected descendant
position active menu item into view left aligned as first item in panel, unless rules to the left column override
2.1.6
last item partially hidden
Align last item right if moving to next.
2.1.7
first item partially hidden
Align first item left if moving previous.
2.2. Content
The navigation content is the actual navigation items and dropdowns. There can potentially be any number of items and can overflow at various points depending on content length and browser size
Logic
condition
description
2.2.1
Partial hidden item
if there is a partially hidden item on either side treat that item as the first item of the next section/panel/view
2.3. Overflow buttons
The overflow buttons allow a user to navigate through the hidden navigation content going from one panel/view to another.
Logic
condition
description
2.3.1
2.1 < 2.2
Only display if nav container width 2.1 is less than the nav content width 2.2
2.3.2
tabindex = -1
Skip keyboard focus. These buttons shouldn't get focus and be accessible to keyboard users.
2.3.1 Left overflow button
Events
name
description
2.3.1.1
click
Triggers to previous event 2.1.2
Logic
condition
description
2.3.1.2
Overflow left
Only displays if there are partial/fully hidden items to the left of the nav container.
2.3.2 Right overflow button
Events
name
description
2.3.2.1
click
Triggers to next event 2.1.1
Logic
condition
description
2.3.2.2
Overflow right
Only displays if there are partial/fully hidden items to the right of the nav container