Navigation

A navigation menu to trigger queries, open other Retool apps, export data, or copy values to the clipboard. It supports a single level of submenu items, and supports both horizontal and vertical orientation.

Navigation can display a logo that performs the same actions as a menu item. It can also use a responsive layout that collapses into a menu icon in horizontal mode, for either smaller viewports or on overflow.

Navigation supports linking an item directly to an app. Doing so will automatically highlight the item (or its parent) when currently viewing its linked app, and hide it for any users who do not have access to its linked app.

Properties

Available properties for Navigation with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read information about components.

NameTypeDescriptionaltTextstring

An accessible image description for screen readers.

appTargetByIndexstring[]

A list of app IDs, by index, for each item.

captionByIndexstring[]

A list of captions for each item, by index.

data{ [key: string]: unknown }[]

The source data for the component.

dbBlobIdstring

Self-hosted Retool deployments only. The ID of the uploaded image when srcType is dbBlobId.

disabledboolean

Whether user input, interaction, or selection is disabled.

disabledByIndexboolean[]

A list of boolean values for each item, by index, that reflect whether they are disabled.

heightType'auto' | 'fixed'

Whether the height automatically resizes to fit content or is a fixed size.

hiddenboolean

Whether the component is visible.

hiddenByIndexboolean[]

A list of boolean values for each item, by index, that reflect whether they are hidden.

highlightByIndexboolean[]

A list of boolean values for each item, by index, that reflect whether they are highlighted.

horizontalAlignment'left' | 'center' | 'right' | 'justify'

The horizontal alignment of the contents.

iconByIndexIconKey[]

A list of icons for each item, by index.

iconPositionByIndex('left' | 'right' | 'top' | 'replace')[]

A list of icon positions for each item, by index, relative to labels.

itemMode'dynamic' | 'static'

The configuration mode for option lists. Either dynamic for mapped options or static for manual options.

itemTypeByIndex('page' | 'app' | 'custom')[]

A list of strings, by index, that reflect the type of item.

keyByIndexstring[]

A list of IDs, by index, for each item.

labelsstring[]

A list of labels for each item. Falls back to the corresponding value if no label is provided.

maintainSpaceWhenHiddenboolean

Whether the component takes up space on the canvas if hidden is true.

marginstring

The amount of margin to render outside of the component.

orientation'horizontal' | 'vertical'

Whether to display the menu vertically or horizontally.

overflowMode'scroll' | 'autoMenu' | 'mobileMenu'

Control when to show a menu button instead of the full menu. Only available in horizontal mode.

parentKeyByIndexstring[]

A list of IDs, by index, for each item that reflects the parent menu item.

retoolFileObjectobject

A file representation that is shared by components on Retool.

retoolStorageDynamicInputboolean

Whether the input for retoolStorageFileId is dynamic.

retoolStorageFileIdstring

The id of the uploaded image when srcType is retoolStorageFileId.

retoolStorageShowLegacyFilesboolean

Toggles the dropdown between Retool Storage files and legacy uploaded files.

screenTargetByIndexstring[]

A list of screen IDs, by index, for each item.

showInEditorboolean

Whether the component remains visible in the editor if hidden is true.

srcstring

The source URL of the image when srcType is src.

srcHeightnumber | null

The height of the source image.

srcType'src' | 'dbBlobId' | 'storageBlobId' | 'retoolStorageFileId' | 'retoolFileObject'

The type of the image source. Either src, dbBlobId, or storageBlobId.

srcWidthnumber | null

The width of the source image.

storageBlobIdstring

The ID of the uploaded image when srcType is storageBlobId.

tooltipByIndexstring[]

A list of captions for each item, by index.

tooltipTextstring

The text to display in a tooltip on hover or focus.

Events

Events are triggered by user interactions with Navigation. Use event handling to trigger queries or other actions in response to events.

NameDescriptionClick

A user clicks a menu item

Logo click

A user clicks on the logo

Methods

Methods for interacting with Navigation. You can write JavaScript almost anywhere in Retool and use methods to manipulate data or components.

NameDescriptionscrollIntoView(options: any)

Scrolls the canvas or parent container so that the selected component appears in the visible area.

setHidden(hidden: boolean)

Set the hidden value to toggle whether the component is visible. Defaults to true without a parameter.

setDisabled(disabled: boolean)

Set the disabled value to toggle whether the input field is disabled. Defaults to true without a parameter.