Skip to main content
Version: v3

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_SHOW_CONFIGURATIONStringLocation for a Tab on a Resource Show Configuration (From Rancher version v2.14.0)
TabLocation.RESOURCE_CREATE_PAGEStringLocation for a Tab on a Resource Create page
TabLocation.RESOURCE_EDIT_PAGEStringLocation for a Tab on a Resource Edit page
TabLocation.RESOURCE_DETAIL_PAGEStringLocation for a Tab on a Resource Detail page
TabLocation.ALLStringGeneric location for a Tab on any given page. Can be further specified with the appropriate LocationConfig params.
TabLocation.CLUSTER_CREATE_RKE2StringLocation for a Tab on the Cluster Configuration area in Cluster Provisioning
TabLocation.RESOURCE_DETAILStringLocation for a Tab on a Resource Detail page

when Object admissible values:

LocationConfig as described above for the LocationConfig object.



TabLocation.RESOURCE_SHOW_CONFIGURATION options

(From Rancher version v2.14.0)

Tabs

options config object. Admissible parameters for the options with 'TabLocation.RESOURCE_SHOW_CONFIGURATION' 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 supersede "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_SHOW_CONFIGURATION,
{ 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')
}
);

TabLocation.RESOURCE_CREATE_PAGE options

(From Rancher version v2.14.0)

Tabs

options config object. Admissible parameters for the options with 'TabLocation.RESOURCE_CREATE_PAGE' 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 supersede "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_CREATE_PAGE,
{ 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')
}
);

TabLocation.RESOURCE_EDIT_PAGE options

(From Rancher version v2.14.0)

Tabs

options config object. Admissible parameters for the options with 'TabLocation.RESOURCE_EDIT_PAGE' 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 supersede "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_EDIT_PAGE,
{ 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')
}
);

TabLocation.RESOURCE_DETAIL_PAGE options

(From Rancher version v2.14.0)

Tabs

options config object. Admissible parameters for the options with 'TabLocation.RESOURCE_DETAIL_PAGE' 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 supersede "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_PAGE,
{ 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')
}
);

TabLocation.ALL options

(From Rancher version v2.14.0)

options config object. Admissible parameters for the options with 'TabLocation.ALL' 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 supersede "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.ALL,
{ 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')
}
);

TabLocation.CLUSTER_CREATE_RKE2 options

(From Rancher version v2.13.0)

Tabs

NOTE: this tab will be added in the CREATE cluster interface, Cluster Configuration. If you want to target a specific provider and rke type use the queryParam in the location config. Ex: queryParam: { type: 'digitalocean', rkeType: 'rke2' }

options config object. Admissable parameters for the options with 'TabLocation.CLUSTER_CREATE_RKE2' 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 supersede "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.CLUSTER_CREATE_RKE2,
{
resource: ['provisioning.cattle.io.cluster'],
queryParam: { type: 'digitalocean', rkeType: 'rke2' }
},
{
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')
}
);

TabLocation.RESOURCE_DETAIL options

(From Rancher version v2.7.2)

deprecated from Rancher version 2.14.0 and onwards - use TabLocation.ALL

Tabs

options config object. Admissible 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 supersede "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')
}
);