Skip to main content

Global Navigation

The Navigation component displays a responsive list of links that can collapse into a mobile-friendly menu.

Polymorphic Component

By default, content is rendered inside a <nav>, but this can be overriden by passing any valid tag name or component with the as prop.

Examples​

Basic Navigation​

The items placed into NavigationFull will be shown until there isn't enough room, or the small breakpoint is hit. Then, the content of NavigationMinimal will be displayed.

Props​

NavigationProps

NameTypeDefault ValueRequiredDescription
All attributes of a <nav />
forceCollapsefalse | trueNoForce the menu to be collapsed?

NavigationBrandProps

NameTypeDefault ValueRequiredDescription
All attributes of a <a />

NavigationCtaProps

NameTypeDefault ValueRequiredDescription
All attributes of a <button />
buttonType"text" | "primary" | "secondary"'primary'NoWhich type of button should be rendered?
flushfalse | truefalseNoRender a text button with no padding?
hrefstringNoThe link to navigate to.
iconComponentClass<any, any> | FunctionComponent<any> | ReactElement<any, string | JSXElementConstructor<any>> | ForwardRefExoticComponent<any>NoAn icon to display at the start of the button. Using an `IconName` string is deprecated.
iconEndComponentClass<any, any> | FunctionComponent<any> | ReactElement<any, string | JSXElementConstructor<any>> | ForwardRefExoticComponent<any>NoAn icon to display at the end of the button. Using an `IconName` string is deprecated.
iconStartComponentClass<any, any> | FunctionComponent<any> | ReactElement<any, string | JSXElementConstructor<any>> | ForwardRefExoticComponent<any>NoAn icon to display at the start the button. Same as `icon`. Using an `IconName` string is deprecated.
loadingfalse | truefalseNoDisplay the loading state?
size"md" | "lg" | "sm"'md'NoHow large should the button be?
state"dark" | "critical" | "success" | "brand"'brand'NoWhich color should the button be?

NavigationDropdownProps

NameTypeDefault ValueRequiredDescription
All attributes of a <ul />
closeRefMutableRefObject<(() => void) | undefined>NoClose the dropdown programmatically.
disabledfalse | trueNoIf disabled, the dropdown will not open, and close if already opened.
megafalse | trueNoShould this be rendered as a mega menu?
titleReactNodeYesThe display text for the dropdown.

NavigationFullProps

NameTypeDefault ValueRequiredDescription
All attributes of a <div />

NavigationItemProps

NameTypeDefault ValueRequiredDescription
All attributes of a <a />

NavigationItemListProps

NameTypeDefault ValueRequiredDescription
All attributes of a <ul />

NavigationMinimalProps

NameTypeDefault ValueRequiredDescription
All attributes of a <div />

NavigationToggleProps

NameTypeDefault ValueRequiredDescription
All attributes of a <button />
buttonType"text" | "primary" | "secondary"'primary'NoWhich type of button should be rendered?
flushfalse | truefalseNoRender a text button with no padding?
iconComponentClass<any, any> | FunctionComponent<any> | ReactElement<any, string | JSXElementConstructor<any>> | ForwardRefExoticComponent<any>NoAn icon to display at the start of the button. Using an `IconName` string is deprecated.
iconEndComponentClass<any, any> | FunctionComponent<any> | ReactElement<any, string | JSXElementConstructor<any>> | ForwardRefExoticComponent<any>NoAn icon to display at the end of the button. Using an `IconName` string is deprecated.
iconStartComponentClass<any, any> | FunctionComponent<any> | ReactElement<any, string | JSXElementConstructor<any>> | ForwardRefExoticComponent<any>NoAn icon to display at the start the button. Same as `icon`. Using an `IconName` string is deprecated.
loadingfalse | truefalseNoDisplay the loading state?
onClick(isMobileMenuOpen: boolean, e: MouseEvent<HTMLButtonElement, MouseEvent>) => voidNo
size"md" | "lg" | "sm"'md'NoHow large should the button be?
state"dark" | "critical" | "success" | "brand"'brand'NoWhich color should the button be?