Navigation Secondary

Overview

Red Hat Secondary Nav

Installation

npm install @rhds/elements

Slots

logo

Logo added to the main nav bar, expects a <a> | <a><svg/></a> | <a><img/></a>

nav

Navigation list added to the main nav bar, expects a <ul>

cta

Nav bar level CTA, expects a `

mobile-menu

Text label for the mobile menu button, for l10n. Defaults to "Menu"

Attributes

main

Define custom attribute 'main' and watch for DOM changes of the attribute

DOM Property
mainNav
Type
boolean
Default
false
color-palette
DOM Property
colorPalette
Type
NavPalette
Default
'light'

Methods

open(index: number)

Public API, opens a specific dropdown based on index. Closes all open dropdowns before opening specified. Toggles overlay to open

close()

Public API, closes all open dropdowns

Events

overlay-change

Fires when an dropdown is opened or closed in desktop view or when the mobile menu button is toggled in mobile view.

Event Type:
SecondaryNavOverlayChangeEvent