visual-framework / vf-core

A (primarily CSS) framework that targets needs of life science websites and services
https://stable.visual-framework.dev/
Apache License 2.0
22 stars 10 forks source link

Component: "super navigation" mega-menu-style component #1718

Closed khawkins98 closed 2 years ago

khawkins98 commented 2 years ago

In #1621 and #1622 as well as the VF July sprint, our investigations pointed to the need for a mega-menu-style component.

This component would allow navigation items to be clicked on and insert/show a horizontal container.

Standard questions

Any further thoughts?

While the UX and design guidance will say how this component should be used, in principle it could be used to show any container.

A few practical questions:

  1. Does the revealed content appear "over" the existing content, or push content down?
  2. Could we reuse vf-tabs somehow?
  3. The JS could attach to any element to show any element
nitinja commented 2 years ago

Hi, note that till we make any ux prototype, I am following UK gov megamenu as a n example implementation https://www.gov.uk/government/organisations

cindyebi commented 2 years ago

2-level navigation hierarchy: 2-level

3-level navigation hierarchy: 3-level

Search: Search

Notes: • We discussed this morning about combining the 2 and 3 hierarchy levels within the menu. If we decided to use the section header layout, let's keep it consistent for all menu items to use the same. • Navigation item that has an expandable [mega] menu will have a caret icon next to the label as a signifier. The caret icon will state the available user action, e.g. pointing down when the menu is closed and pointing up when the menu is opened. • Mega menu items will be displayed in blue to signify clickable links.

khawkins98 commented 2 years ago

I'm thinking about that green line, which also exists similarly on the top of vf-footer. Thinking it could be componentised as a vf-divider--enclosure or something like that.

image
khawkins98 commented 2 years ago

Technical thoughts on the caret in the navigation, this could be appended by CSS with something like:

.vf-megamenu.vf-megamenu__activated .vf-navigation__link.vf-megamenu__item--has-section

khawkins98 commented 2 years ago

The menu entries could be .vf-mega-menu__toggle

image

And the megamenu that activates could be .vf-mega-menu__section

nitinja commented 2 years ago

@khawkins98 thanks, I am thinking something similar

cindyebi commented 2 years ago

I added an overlay so when the mega menu is active, it is in focus. Unless the mega menu is covering up the entire page, we don't need the overlay.

3-level

Search

2-level

cindyebi commented 2 years ago

Mockup on how it looks like on the COVID-19 data portal: 3-level-covid19

OliveiraCs commented 2 years ago

Mockups EMBL-EBI Corporate site: IA to be reviewed( in progress)

EMBL-EBI_megm-v2 3-level EMBL-EB_megm_3-level EMBL-EBI_megm-2-level EBML-EBI megamenu 3-level

cindyebi commented 2 years ago

Mobile version: • Homepage: instead of using a hamburger menu, it is recommended to use the label "Menu" for better discoverability. It's also adopted by the gov.uk site.

Homepage

• Search is separate from the main Menu and once expanded uses the vf-search-mini component that was designed specifically for mobile or small screen sizes.

Search

Menu - Expanded: shows the first level navigation menus using an accordion or similar to the vf-details component. Menu options are labeled in link blue to signify clickability.

Expanded 1

Menu - Expanded 2 v1: shows the second level navigation menus with slight indentation to have a better visual distinction between each hierarchy.

Expanded 2 v1

Menu - Expanded 2 v2: shows the second and third level navigation menus with scrolling behaviour to reveal the rest of the menu.

Expanded 2 v2