Developer Programs

Learn

Docs

Header Dropdown Button

Components > Application Layout > Header Dropdown Button
Use this component to...
Present a button in the right side of your application header that toggles a small dropdown menu when pressed

Overview

Use this component to display a dropdown button in your app header. This dropdown button toggles the display of a dropdown menu when pressed.

This can help you save space in your header, since you can combine several options with one button.

Only add header dropdowns to the right side of the header.


Development

Web component development

Component reference

rui-header-dropdown
rui-header-dropdown
Module: rui-header - Package: @jkhy/responsive-ui-wc

Dropdown button in right side of header bar; allows you to group several options under one button

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.
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.
alignmentstring'left'By default, the dropdown menu aligns to the left side of its button. If the button is at the far right of the header, the dropdown’s content can be clipped. If this happens, set this attribute to a value of ‘right’ and the dropdown menu will be aligned to the right edge of the button, preventing clipping
menuWidthnumber-1If you need to override the default dropdown menu width, assign a number for this property that specifies the pixel width needed.
isDisabledbooleanfalseSpecifies whether the dropdown button is disabled.
allowMixedCasebooleanfalseOur standard is for header buttons to uppercase their text. In certain rare cases, this uppercasing can be inappropriate. For example, the button text may refer to a product name that must include a lower case character for trademark purposes. In these rare cases, set this property to true to preserve mixed case for the button.
rui-header-dropdown-option
rui-header-dropdown-option
Module: rui-header - Package: @jkhy/responsive-ui-wc

Option in header dropdown menu

NameTypeDefaultDescription
textstring''Text displayed in the option
isCheckedBooleanfalseSpecifies whether a checkmark displays to the left of the menu option text.
badgestring''Optional text that is highlighted to the right of the option text. Often used to display a count of data items that can be accessed when the user presses the option.
routestring''If the dropdown option links to a view within the app, this specifies the route for that view.
rui-header-dropdown-option-clickeventFired when the user clicks the dropdown option.
rui-header-dropdown-submenu
rui-header-dropdown-submenu
Module: rui-header - Package: @jkhy/responsive-ui-wc

Tiered submenu in header dropdown menu

NameTypeDefaultDescription
textstring''Text displayed in the header dropdown submenu option
alignmentstring'left'Specifies whether the dropdown submenu is anchored on the left, or on the right. If left blank, component will attempt to determine best opening alignment based on placement and space available.
rui-header-dropdown-separator
rui-header-dropdown-separator
Module: rui-header - Package: @jkhy/responsive-ui-wc

Separator between groups of options in header dropdown menu

No properties or events

Implementation

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

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

Use rui-header-dropdown for a button that toggles a small dropdown menu of options when pressed.

Use rui-header-dropdown if the number of menu options to display is relatively small, otherwise use rui-header-mega-menu.

Nest one or more rui-header-dropdown-option elements within the rui-header-dropdown for the dropdown elements.

rui-header-dropdown has an alignment attribute with values of “left” or “right”, that specifies whether the dropdown menu should align to the left or right edge of the dropdown button. Leave this attribute at its default value of “left” unless the dropdown is at the far right of the header and the dropdown menu options are getting clipped off the right.

You can optionally separate dropdown options with the rui-header-dropdown-separator component.

The example below adds a dropdown button to the right side of the header with options for changing the theme.

Using the component
<!-- Header: Defines application name and admin options that display in header -->
<rui-header [displaySearch]="true" searchWidth="50%" searchWatermarkText="SEARCH" (rui-header-search)="search($event)">

    <!-- Left side -->
    <rui-header-left [displayBackButton]="displayBackButton" (rui-back-button-click)="backButtonClicked()">

        <!-- Left side content -->

    </rui-header-left>

    <!-- Right side -->
    <rui-header-right>

        <!-- Header dropdown -->
        <rui-header-dropdown class="rui-hidden-mobile" iconType="palette" text="Theme">

            <rui-header-dropdown-option *ngFor="let themeColor of themeColors; let i=index"
                text="{{themeColor.name}}" (rui-header-dropdown-option-click)="changeThemeColor(i)">
            </rui-header-dropdown-option>

        </rui-header-dropdown>

    </rui-header-right>

</rui-header>

Angular wrapper development

Wrapper reference

jha-header-dropdown
jha-header-dropdown
Module: JhaHeaderModule - Package: @jkhy/responsive-ui-angular

Dropdown button in right side of header bar; allows you to group several options under one button

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.
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.
jhaAlignmentstring'Left'By default, the dropdown menu aligns to the left side of its button. If the button is at the far right of the header, the dropdown’s content can be clipped. If this happens, set this attribute to a value of ‘Right’ and the dropdown menu will be aligned to the right edge of the button, preventing clipping
jhaMenuWidthnumber-1If you need to override the default dropdown menu width, assign a number for this property that specifies the pixel width needed.
jhaIsDisabledbooleanfalseSpecifies whether the dropdown button is disabled.
jhaAllowMixedCasebooleanfalseOur standard is for header buttons to uppercase their text. In certain rare cases, this uppercasing can be inappropriate. For example, the button text may refer to a product name that must include a lower case character for trademark purposes. In these rare cases, set this property to true to preserve mixed case for the button.
jha-header-dropdown-option
jha-header-dropdown-option
Module: JhaHeaderModule - Package: @jkhy/responsive-ui-angular

Option in header dropdown menu

NameTypeDefaultDescription
jhaTextstring''Text displayed in the option
jhaTooltipstring''Tooltip to display when the mouse hovers over the option
jhaIsCheckedBooleanfalseSpecifies whether a checkmark displays to the left of the menu option text.
jhaBadgestring''Optional text that is highlighted to the right of the option text. Often used to display a count of data items that can be accessed when the user presses the option.
jhaRouterLinkstring''If the dropdown option links to a view within the app, this specifies the route for that view.
jhaExternalUrlstring''If the dropdown option links to a URL outside of the app, this specifies the URL.
jhaExternalUrlInNewWindowbooleantrueIf the dropdown option links to a URL outside of the app, leave this at its default value of true if that link should open in a new tab/window. Otherwise set this to false.
clickeventIf the dropdown option executes code, define a click event handler for it.
jha-header-dropdown-submenu
jha-header-dropdown-submenu
Module: JhaHeaderModule - Package: @jkhy/responsive-ui-angular

Tiered submenu in header dropdown menu

NameTypeDefaultDescription
jhaTextstring''Text displayed in the header dropdown submenu option
jhaAlignmentstring'left'Specifies whether the dropdown submenu is anchored on the left, or on the right. If left blank, component will attempt to determine best opening alignment based on placement and space available.
jha-header-dropdown-separator
jha-header-dropdown-separator
Module: JhaHeaderModule - Package: @jkhy/responsive-ui-angular

Separator between groups of options in header dropdown menu

No properties or events

Implementation

Begin by importing the jha-header module into your application.

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

Use jha-header-dropdown for a button that toggles a small dropdown menu of options when pressed.

Use jha-header-dropdown if the number of menu options to display is relatively small, otherwise use jha-header-mega-menu.

Nest one or more jha-header-dropdown-option elements within the jha-header-dropdown for the dropdown elements.

jha-header-dropdown has an jhaAlignment attribute with values of “Left” or “Right”, that specifies whether the dropdown menu should align to the left or right edge of the dropdown button. Leave this attribute at its default value of “Left” unless the dropdown is at the far right of the header and the dropdown menu options are getting clipped off the right.

You can optionally separate dropdown options with the jha-header-dropdown-separator component.

The example below adds a dropdown button to the right side of the header with options for changing the theme.

Using the component
<!-- Header: Defines application name and admin options that display in header -->
<jha-header [jhaIsHidden]="hideHeader" jhaDisplaySearch="true" jhaSearchWidth="50%"
    jhaSearchWatermarkText="SEARCH" (jhaSearch)="search($event)">
    
    <!-- Left side -->
    <jha-header-left [jhaDisplayBackButton]="displayBackButton" (jhaBackButtonClicked)="backButtonClicked()">

        <!-- Left side content -->

    </jha-header-left>

    <!-- Right side -->
    <jha-header-right>

        <!-- Header dropdown -->
        <jha-header-dropdown class="jha-hidden-phone" jhaIconType="Information" jhaText="Dropdown"
            jhaTooltip="Example of header dropdown">

            <jha-header-dropdown-option *ngFor="let themeColor of themeColors; let i=index"
                jhaText="{{themeColor.name}}" (click)="changeThemeColor(i)">
            </jha-header-dropdown-option>

        </jha-header-dropdown>
    </jha-header-right>

</jha-header>

Component playground


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
Header dropdown button

RUI / Header / Dropdown Button

Available values for the State property:

  • Inactive
  • Active
  • Menu Displayed
Header button badgeRUI / Header / Button Badge
Header dropdown menuRUI / Header / Dropdown Menu
Header dropdown menu itemAdd text, then apply rui/regular as the Text Style and rui-pacific/btn-primary-fg as the Color Style
Header dropdown menu separatorRUI / Header / Dropdown Menu Separator

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 ComponentDesign Component Name
Header dropdown button - inactiveJHA / Header / Dropdown Button / Inactive
Header dropdown button - activeJHA / Header / Dropdown Button / Active
Header dropdown menuJHA / Header / Dropdown Menu
Header dropdown menu itemJHA / Text / Header Dropdown Menu Item
Header dropdown menu separatorJHA / Header / Dropdown Menu Separator

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 Wed Sep 25 2024