Nav

Components > Application Layout > Nav
Use this component to...
Present the primary navigation for your application

Overview

This is a navigation bar in a responsive application, with the other sections darkened for contrast.
Application layout navigation

The nav bar component displays at the left side of your application, presenting the primary navigation options to your users.

The nav bar can include:

  • Navigation buttons that let the user navigate to a single function
  • Navigation mega menus that let the user choose from a large menu of functions to navigate to
  • Optional separators that can be used to visually group related navigation items

Development

Web component development

Component reference

rui-nav
rui-nav
Module: rui-nav - Package: @jha/rui-wc

Presents the primary navigation options for your application

Name Type Default Description
displayState string 'expanded'

By default, when your application loads, the nav bar is collapsed at mobile size and is expanded at larger sizes.

If you need to override that behavior, set this property to a value of ‘collapsed’ if you want the nav bar always initially collapsed regardless of screen size, or set this to a value of ’expanded’ if you want the nav bar always initially expanded, regardless of screen size.

Note that this only defines the initial expanded/collapsed state; the user can manually expand and collapse the nav bar at will.

expandOnHoverWidth number 230 If the nav bar is collapsed, it automatically expands whenever the mouse hovers over it in order to make all nav options more readable. The default width of the nav bar for this expand-on-hover behavior is 230 pixels. You can override that width with a larger value if needed to avoid clipping.
rui-nav-display-state event

Fired when the nav bar display state changes. The current display state — ’expanded’ or ‘collapse’ — is sent in the event detail.

You can listen for this event if you want to store the most recent expanded/collapsed state in local storage in order to restore the nav bar state the next time the user starts the application.

Implementation

Begin by importing the rui-nav module into your application.

Import the module
// import into app.module
import '@jha/rui-wc/components/rui-nav/rui-nav-imports';

Define your app’s primary navigation options within the main-nav component. Use a rui-nav tag as the outermost element in that view.

If the navigation bar is collapsed, it will temporarily expand when the user hovers the mouse over it. If the text for any nav bar elements is being truncated with ellipses, you can override the width of the expand-on-hover navigation bar by changing the value of the expandOnHoverWidth numeric attribute in rui-nav. The default value is 230, but you can increase this to fit your items with long names.

rui-nav also has a displayState attribute that allows you to override the default initial expand/collapse state (initially expanded at desktop size and initially collapsed at tablet size). Specify a value of “collapsed” if the nav bar should be initially collapsed regardless of screen width. Specify a value of “expanded” if the nav bar should be initially expanded regardless of screen width. Omit this attribute if you want the default initial expanded/collapsed state described above.

Using the component
<rui-nav>

    <!-- Primary navigation options go here -->

</rui-nav>

Angular component development

Component reference

jha-nav
jha-nav
Module: JhaNavModule - Package: @jha/jharesponsive

Presents the primary navigation options for your application

Name Type Default Description
jhaInitialState string ''

Omit this attribute to get the default initial behavior, where the nav bar is collapsed at smaller sizes and expanded at larger sizes.

If you need to override that behavior, set this to ‘Collapsed’ if you want the nav bar always initially collapsed regardless of screen size, or set this to ‘Expanded’ if you want the nav bar always initially expanded regardless of screen size.

Note that this only defines the initial expanded/collapsed state; the user can manually expand and collapse the nav bar at will.

jhaIsHidden boolean false Set this to true if your application should not display a navigation bar. This should be extremely rare for any Jack Henry application.
jhaExpandOnHoverWidth number 230 If the nav bar is collapsed, it automatically expands whenever the mouse hovers over it in order to make all nav options more readable. The default width of the nav bar for this expand-on-hover behavior is 230 pixels. You can override that width with a larger value if needed to avoid clipping.

Implementation

Begin by importing the JhaNavModule into your application.

Import the module
// import into app.module
import { JhaNavModule } from '@jha/jharesponsive/jha-nav';

@NgModule({
    imports: [
        ...
        JhaNavModule,
        ...
    ]
})

export class AppModule(){}

Define the navigation within your main-nav component. Use a jha-nav tag as the outermost element in that view. It has a jhaIsHidden attribute that you can bind to a Boolean value in your controller to specify when the navigation should be hidden. You should hide the navigation when your application is hosted within Xperience.

If the navigation bar is collapsed but temporarily expanded on hover, then any items with text too long to fit in the nav bar are truncated with ellipses. If you see this happening, you can override the width of the expand-on-hover navigation bar by changing the value of the jhaExpandOnHoverWidth numeric attribute in jha-nav. The default value is 230, but you can increase this to fit your items with long names.

jha-nav also has a jhaInitialState attribute that allows you to override the default initial expand/collapse state (initially expanded at desktop size and initially collapsed at tablet size). Specify a value of “collapsed” if the nav bar should be initially collapsed regardless of screen width. Specify a value of “expanded” if the nav bar should be initially expanded regardless of screen width. Omit this attribute if you want the default initial expanded/collapsed state described above.

Using the component
<jha-nav [jhaIsHidden]="hideHeader">

    <!-- Primary navigation options go here -->

</jha-nav>

Design

Figma design

Figma design info
You can find this component in the Components - Application Layout page in the Figma UI Kit.
Dev Component Design Component Name
Nav bar

RUI / Nav / Nav Bar

Turn on the Collapsed property for a collapsed nav bar; leave it off for an expanded nav bar

Expanded nav components
Basic header components
Collapsed nav components
Basic header components

Adobe XD design

Adobe XD design info
You can find this component in these artboards in the Adobe XD design samples:
  • Layout - Header, Expanded Nav, Function View
  • Layout - Header, Collapsed Nav, Function View
  • Layout - Nav Elements - Expanded Nav Bar
  • Layout - Nav Elements - Collapsed Nav Bar
  • Layout - Nav Mega Menu
  • Layout - Header Elements – Basics
  • Layout - Header Menu Buttons
  • Layout - Header Mega Menu
  • Layout - Mobile Application
  • Layout - Tablet Application – Portrait
  • Layout - Tablet Application - Landscape
Dev Component Design Component Name
Nav bar - expanded JHA / Nav / Expanded / Nav Bar
Nav bar - collapsed JHA / Nav / Collapsed / Nav Bar
Basic header components
Collapsed nav components
Basic header components

Support options
Have questions on this topic?
Join the Responsive UI team in Microsoft Teams to connect with the community.
See something in this page that needs to change?
Send us feedback on this page.
Last updated Thu Feb 9 2023