Skip to main content

Tabs

Tabs present custom content inside a new Tab of an existing Tabbed Area section within the Rancher UI.

Tabs are added to Rancher via the addTab method.

addTab

(Rancher version v2.7.2)

This method adds a tab to the UI.

Method:

plugin.addTab(where: String, when: LocationConfig, options: Object);

Arguments

where string parameter admissable values for this method:

KeyTypeDescription
TabLocation.RESOURCE_DETAILStringLocation for a Tab on a Resource Detail page

when Object admissable values:

LocationConfig as described above for the LocationConfig object.



TabLocation.RESOURCE_DETAIL options

Tabs

options config object. Admissable parameters for the options with 'TabLocation.RESOURCE_DETAIL' are:

KeyTypeDescription
nameStringQuery param name used in url when tab is active/clicked
labelStringText for the tab label
labelKeyStringSame as "label" but allows for translation. Will superseed "label"
weightIntDefines the order on which the tab is displayed in relation to other tabs in the component
showHeaderBooleanWhether the tab header is displayed or not
tooltipStringTooltip message (on tab header)
componentFunctionComponent to be rendered as content on the tab

Usage example:

plugin.addTab( 
TabLocation.RESOURCE_DETAIL,
{ resource: ['pod'] },
{
name: 'some-name',
labelKey: 'plugin-examples.tab-label',
label: 'some-label',
weight: -5,
showHeader: true,
tooltip: 'this is a tooltip message',
component: () => import('./MyTabComponent.vue')
}
);