@visual-framework/vf-mega-menu
v1.0.2
Published
vf-mega-menu component
Downloads
158
Readme
Mega menu component
About
Paired with a good understanding of a site's information architecture and user journey, the mega menu can empower quick shortcut-style access to popular areas.
Usage
The mega menu should be seen as a empowering but optional feature. While a mega menu may allow a user to quickly move to a sub-section of a website, or laterally move from one silo to another, that empowering ability should be viewed as an optional user journey.
Some users may fail to notice the mega menu by scrolling past it, be on a mobile device where the menu behaves differently, or the JavaScript-based feature may fail to load making the mega menu inaccessible.
A user journey should always be possible without the mega menu's content.
It is recommended to put your mega menu links at the vf-global-header
level.
Caveats
- The mega menu currently is not designed to work on mobile
- In principle any content can be inserted into a mega menu
- Using more than one mega menu on a page is likely to confuse and overwhelm users
- A mega menu is not a substitute for a good information architecture
Accessibility
This component targets WCAG 2.1 AA accessibility.
Hiding critical or essintal information in a mega menu is harmful to users.
Install
This repository is distributed with [npm][https://www.npmjs.com/]. After [installing npm][https://www.npmjs.com/get-npm] and yarn, you can install vf-mega-menu
with this command.
$ yarn add --dev @visual-framework/vf-mega-menu
JS
You should import this component in ./components/vf-component-rollup/scripts.js
or your other JS process:
import { vfComponentName } from 'vf-mega-menu/vf-mega-menu';
// Or import directly
// import { vfComponentName } from '../components/raw/vf-mega-menu/vf-mega-menu.js';
vfComponentName(); // if needed, invoke it
Sass/CSS
The style files included are written in Sass. If you're using a VF-core project, you can import it like this:
@import "@visual-framework/vf-mega-menu/vf-mega-menu.scss";
Make sure you import Sass requirements along with the modules. You can use a project boilerplate or the vf-sass-starter