Overview

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

color-palette
DOM Property
colorPalette
Type
NavPalette
Default
'lighter'

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
© 2021-2023 Red Hat, Inc. Deploys by Netlify