Tabs

A set of tabs to choose from a list of options. It supports manual or dynamic configuration of an option list, and can be linked to Container to create Tabbed Containers.

Properties

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

NameTypeDescriptionvaluestring | number | boolean | null | undefined

The current value.

alignment'left' | 'center' | 'right' | 'justify'

The horizontal alignment of the contents.

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

The source data for the component.

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.

hiddenboolean

Whether the component is visible.

hiddenByIndexboolean[]

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

iconByIndexIconKey[]

A list of icons for each item, by index.

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

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.

labelsstring[]

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

linePosition'bottom' | 'top'

The line position.

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.

navigateContainerboolean

Whether the component is linked to a container for navigation.

selectedIndexnumber | null

The currently selected value, by index.

selectedItemunknown | null

The currently selected item.

selectedLabelstring

The label of the currently selected value, by index.

showInEditorboolean

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

targetContainerIdstring

The ID of the Container component when navigateContainer is true.

tooltipByIndexstring[]

A list of tooltips for each item, by index.

values(string | number | boolean | null | undefined)[]

A list of possible values.

Events

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

NameDescriptionChange

A user changes the current value.

Methods

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

NameDescriptionsetValue(value: boolean | string | number | void, strict: any)

Set the value of the component. If the component is linked to a container then it also updates the container's current view.

clearValue()

Clear the current value.

scrollIntoView(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.

resetValue()

Reset value to the default value.