An accessible navigation component to help create a masthead.
The responsive navigation component is a normal horizontal navigation on large screen, and collapses down to an off-canvas model on small viewports. The default HTML should work within the confines of WordPress, but some modifications may have to be implemented for your specific use case. No jQuery is required.
* Standalone JS is used on projects that are not set up to handle
ES6. To use this version you will need to download the compiled
project. The same process should be
followed with the CSS if it cannot process through the NPM package.
This component accepts two arguments, the selector for the navigation container and an object containing configuration settings and optional callbacks.
npm install @10up/component-navigation --save
List of Options for this component
The action to use to open menu items (default) hover
List of Callbacks for this component
Called after the component is initialized on page load
Called when a menu item is opened
Called when a menu item is closed
Called when a submenu item is opened
Called when a submenu item is closed
List of Classes used for this component
Wrapping class for the component.
The navigation menu itself, also the target for the method call.