Developer Programs

Learn

Docs

Nav Button

Components > Application Layout > Nav Button
Use this component to...
Present a simple navigation button in your nav bar

Overview

Use this component to display a simple nav button in your nav bar.


Development

Web component development

Component reference

rui-nav-button
rui-nav-button
Module: rui-nav - Package: @jkhy/responsive-ui-wc

Simple button in right side of nav bar

NameTypeDefaultDescription
textstring''Text displayed in the button
iconTypestring''

The name of the icon to display in the button. You can find a list of all enterprise icons here. The use of custom icons is also supported.

Leave the iconType blank if you want to display initials based on the button text instead of an icon. For example, if the button text is “Additional Overrides” and no icon is specified, the button would display “AO” instead of an icon.

iconInitialsstring''If you left iconType blank so that the button displays initials for the icon, you can use this property to override the initials displayed if you need to. You would typically only do this if the calculated initials were non-unique or unsuitable for any reason.
badgestring''Optional text that is highlighted to the right of the button text. Often used to display a count of data items that can be accessed when the user presses the button.
routestring''

If the button links to a view within the app, assign the route for that view to this attribute.

You must prefix the route with “/#” in Angular applications.

isDisabledbooleanfalseSpecifies whether the button is disabled.

Implementation

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

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

The example below adds a simple nav button to the nav bar that navigates to the Settings page.

Using the component
<rui-nav>

    <!-- Settings -->
    <rui-nav-button iconType="settings" text="Settings" route="/#/Settings"></rui-nav-button>

</rui-nav>

Angular wrapper development

Wrapper reference

jha-nav-button
jha-nav-button
Module: JhaNavModule - Package: @jkhy/responsive-ui-angular

Simple button in right side of nav bar

NameTypeDefaultDescription
jhaTextstring''Text displayed in the button
jhaIconTypestring''

The name of the icon to display in the button. You can find a list of all enterprise icons here. The use of custom icons is also supported.

Leave the iconType blank if you want to display initials based on the button text instead of an icon. For example, if the button text is “Additional Overrides” and no icon is specified, the button would display “AO” instead of an icon.

jhaIconInitialsstring''If you left jhaIconType blank so that the button displays initials for the icon, you can use this property to override the initials displayed if you need to. You would typically only do this if the calculated initials were non-unique or unsuitable for any reason.
jhaTooltipstring''Tooltip to display when the mouse hovers over the button
jhaBadgestring''Optional text that is highlighted to the right of the button text. Often used to display a count of data items that can be accessed when the user presses the button.
jhaRouterLinkstring''If the button links to a view within the app, assign the route for that view to this attribute. If the button executes code, define a click event handler for it. Otherwise if the button links to a URL outside of the app, set the outside URL to the jhaExternalUrl attribute.
jhaRouterLinkActiveOptionsobject{}

If the active router link options need to be set, use this attribute. Pass in an object just like you would for the routerLinkActiveOptions directive.

For example:
[jhaRouterLinkActiveOptions]="{exact: true}"

jhaExternalUrlstring''If the button links to a view within the app, set its jhaRouterLink to the route for that view. If the button executes code, define a click event handler for it. Otherwise if the button links to a URL outside of the app, assign that URL to this attribute.
jhaExternalUrlInNewWindowbooleantrueIf the button links to a URL outside of the app, set this to true if that link should be opened in a new tab/window. Otherwise bind this to a false value.
jhaIsDisabledbooleanfalseSpecifies whether the button is disabled.

Implementation

Begin by importing the JhaNavModule into your application.

Import the module
// import into app.module
import { JhaNavModule } from '@jkhy/responsive-ui-angular/jha-nav';

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

export class AppModule(){}

The example below adds a simple nav button to the nav bar that navigates to the Settings page.

Using the component
<jha-nav>

    <!-- Settings -->
    <jha-nav-button jhaIconType="settings" jhaText="Settings" jhaRouterLink="/Settings"></jha-nav-button>

</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 ComponentDesign Component Name
Nav button

RUI / Nav / Button

Available values for the State property:

  • Inactive
  • Active

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

Nav button badgeRUI / Nav / Button Badge

Adobe XD design

Adobe XD design info
You can find this component in these artboards in the Adobe XD design samples:
  • Layout - nav, Expanded Nav, Function View
  • Layout - nav, Collapsed Nav, Function View
  • Layout - Nav Elements - Expanded Nav Bar
  • Layout - Nav Elements - Collapsed Nav Bar
  • Layout - Nav Mega Menu
  • Layout - nav Elements – Basics
  • Layout - nav Menu Buttons
  • Layout - nav Mega Menu
  • Layout - Mobile Application
  • Layout - Tablet Application – Portrait
  • Layout - Tablet Application - Landscape
Dev ComponentDesign Component Name
Nav button - expanded, inactiveJHA / Nav / Expanded / Button / Inactive
Nav button - expanded, activeJHA / Nav / Expanded / Button / Active
Nav button - collapsed, inactiveJHA / Nav / Collapsed / Button / Inactive
Nav button - collapsed, activeJHA / Nav / Collapsed / Button / Active

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 Mon Oct 30 2023