Skip to main content

Navigation

Rocket 2.0

The Navigation component is a sidebar or top bar of menu items for moving between sections of an app, such as Dashboard, Orders and Settings. Items can have icons, badges, group headings and one level of child items.

Properties​

Property
Description
Expected Value
ItemsItems in the menu. Each item has a label and a value, and can add an icon, badge, group, disabled, visible, separator or children.Array
Active item (value)Value of an item to make active. When this changes, the active item moves to it without firing On click.Text
Selected itemValue of the item that is active.Text. Default: dashboard
OrientationVertical shows a sidebar; Horizontal shows a top bar where items with children open as dropdowns.Vertical, Horizontal. Default: Vertical
VariantHow the active item is marked. Pills fills it, Underline draws a line under it and Ghost keeps it light.Pills, Underline, Ghost. Default: Pills
SizeHeight and text size of the items.Sm, Default, Lg. Default: Default
Align (top bar)Where the items sit in a horizontal top bar. Stretch spreads them across the full width.Start, Center, End, Stretch. Default: Start
Collapsed (icon-only sidebar)Shrinks a vertical sidebar to a narrow rail that shows only icons. Items with children open as a dropdown.On or off. Default: Off
Show collapse buttonShows a button at the end of a vertical sidebar that collapses and expands it.On or off. Default: Off
Loading lookWhat shows while the component is loading: a spinner or a skeleton outline of the menu.Spinner, Skeleton. Default: Spinner

Additional Actions​

Each of these can be switched on or off, or set with a logical expression by clicking fx.

Property
Description
Expected Value
VisibilityShows or hides the component. Hidden components keep their space unless Collapse when hidden is on.On or off. Default: On
Collapse when hiddenRemoves the hidden component's space, so the components below it move up.On or off. Default: Off
Loading stateShows the component's loading look and blocks interaction, for example while a query runs.On or off. Default: Off
DisableStops the user from interacting with the component.On or off. Default: Off

Devices​

Property
Description
Expected Value
Show on desktopShows the component in the desktop layout.On or off. Default: On
Show on mobileShows the component in the mobile layout.On or off. Default: Off

Events​

Add a handler from the Events section of the properties panel. See Event Triggers for the steps.

Event
Description
On clickTriggers when the user clicks an item.

Component Specific Actions (CSA)​

Run these from an event handler with Control Component, or from a RunJS query. See Component Specific Actions.

Action
Description
How To Access
Select itemMakes the item with the given Item value active.components.navigation1.selectItem("")
Set item visibilityShows or hides the item with the given Item value until Items changes.components.navigation1.setItemVisibility("", "{{true}}")
Set item disableDisables or enables the item with the given Item value until Items changes.components.navigation1.setItemDisable("", "{{true}}")
Set collapsedCollapses the sidebar to icons only, or expands it.components.navigation1.setCollapsed("{{true}}")
Set visibilityShows the component when true, hides it when false.components.navigation1.setVisibility(false)
Set disableDisables the component when true, enables it when false.components.navigation1.setDisable(false)
Set loadingTurns the loading state on with true, off with false.components.navigation1.setLoading(false)

Exposed Variables​

Variable
Description
How To Access
itemsItems in the menu. Each item has a label and a value, and can add an icon, badge, group, disabled, visible, separator or children.{{components.navigation1.items}}
defaultValueValue of an item to make active. When this changes, the active item moves to it without firing On click.{{components.navigation1.defaultValue}}
valueValue of the item that is active.{{components.navigation1.value}}
orientationVertical shows a sidebar; Horizontal shows a top bar where items with children open as dropdowns.{{components.navigation1.orientation}}
variantHow the active item is marked. Pills fills it, Underline draws a line under it and Ghost keeps it light.{{components.navigation1.variant}}
sizeHeight and text size of the items.{{components.navigation1.size}}
alignWhere the items sit in a horizontal top bar. Stretch spreads them across the full width.{{components.navigation1.align}}
collapsedShrinks a vertical sidebar to a narrow rail that shows only icons. Items with children open as a dropdown.{{components.navigation1.collapsed}}
showCollapseButtonShows a button at the end of a vertical sidebar that collapses and expands it.{{components.navigation1.showCollapseButton}}
loadingIndicatorWhat shows while the component is loading: a spinner or a skeleton outline of the menu.{{components.navigation1.loadingIndicator}}
selectedItemThe active item, with its label and value.{{components.navigation1.selectedItem}}
previousSelectedItemThe item that was active before the current one.{{components.navigation1.previousSelectedItem}}
isCollapsedWhether the sidebar is collapsed to icons only.{{components.navigation1.isCollapsed}}
isVisibleWhether the component is visible.{{components.navigation1.isVisible}}
isLoadingWhether the component is in its loading state.{{components.navigation1.isLoading}}
isDisabledWhether the component is disabled.{{components.navigation1.isDisabled}}

Styles​

Style
Default
Backgroundtransparent
Item text colorTheme: Primary text
Item icon colorTheme: Primary text
Item hover backgroundTheme: Surface 3
Active item backgroundTheme: Surface 3
Active item text colorTheme: Primary text
Active indicator color (underline)Theme: Brand primary
Badge backgroundTheme: Surface 3
Badge text colorTheme: Placeholder text
Group heading colorTheme: Placeholder text
Separator colorTheme: Default border
Item radius—
Box shadow0px 0px 0px 0px #00000040

A default that starts with Theme: follows the app's theme until the style is set to another value. See App Themes.