Completed V3 Basic Migration:
<gux-tabs-legacy show-new-tab-button="true" allow-sort="true">
<gux-tab-legacy tab-id="1" tab-icon-name="agent">
<span slot="title">Tab Header 1</span>
<span slot="dropdown-options">
<gux-tab-dropdown-option-legacy option-id="1" icon-name="edit">
Edit
</gux-tab-dropdown-option-legacy>
<gux-tab-dropdown-option-legacy option-id="2" icon-name="clone">
Clone
</gux-tab-dropdown-option-legacy>
</span>
</gux-tab-legacy>
<gux-tab-legacy tab-id="2" tab-icon-name="user-directory">
<span slot="title">Tab content 2</span>
</gux-tab-legacy>
</gux-tabs-legacy>
There are now two stable versions of tabs available to use in v4: gux-tabs
and gux-tabs-advanced
. gux-tabs-advanced
contains all of the functionality in gux-tabs-legacy
, including sorting and options. gux-tabs is a simpler tabs API that does not include sorting or tab options.
TLDR: If you use tab options, sorting or new tab button, migrate to gux-tabs-advanced. If you just require a simple tabs component, you can choose to migrate to either gux-tabs-advanced or gux-tabs. gux-tabs is the recommended component to use for simple tab interfaces.
Steps:
-
Replace the
gux-tabs-legacy
tag name withgux-tabs-advanced
- <gux-tabs-legacy> + <gux-tabs-advanced> ... - </gux-tabs-legacy> + </gux-tabs-advanced>
-
Replace the
gux-tab-legacy
tag name withgux-tab-advanced
.- The
tab-icon-name
property has been removed. Slot the icon in thegux-tab-advanced
component instead. - The
title
named slot has been removed. Slot the text directly into thegux-tab-advanced
component.
- <gux-tab-legacy tab-id="1" tab-icon-name="agent"> - <span slot="title">Tab Header 1</span> - </gux-tab-legacy> + <gux-tab-advanced tab-id="1"> + <gux-icon icon-name="agent" decorative="true"></gux-icon> + Tab Header 1 + </gux-tab-advanced>
- The
-
Replace the
<span slot="dropdown-options">
with<gux-list slot="dropdown-options>
. Remove thegux-tab-dropdown-option
component and usegux-list-item
instead:- <span slot="dropdown-options"> - <gux-tab-dropdown-option-legacy - option-id="1" - icon-name="edit" - > + <gux-list slot="dropdown-options"> + <gux-list-item> + <gux-icon icon-name="edit" decorative="true"></gux-icon> Edit - </gux-tab-dropdown-option> - </span> + </gux-list-item> + </gux-list>
-
Nest the
gux-tab-advanced
components withingux-tab-advanced-list
. Theshow-new-tab-button
andallow-sort
properties should be set on thegux-tab-advanced-list
component.<gux-tabs-advanced> + <gux-tab-advanced-list slot="tab-list" show-new-tab-button="true" allow-sort="true"> <gux-tab-advanced tab-id="2"> <gux-icon icon-name="user-directory" decorative="true"></gux-icon> Tab Header 2 </gux-tab-advanced> ... + </gux-tab-advanced-list> ... </gux-tabs-advanced>
-
For accessibility reasons, tabs need associated tab panels. Add
gux-tab-advanced-panel
components that will act as containers for your tab panel content. Associate the tab panel with its tab by setting thetab-id
property on thegux-tab-advanced
andgux-tab-advanced-panel
to the same value.
Completed Migration to gux-tabs-advanced
<gux-tabs-advanced>
<gux-tab-advanced-list
slot="tab-list"
show-new-tab-button="true"
allow-sort="true"
>
<gux-tab-advanced tab-id="1">
<gux-icon icon-name="agent" decorative="true"></gux-icon>
Tab Header 1
<gux-list slot="dropdown-options">
<gux-list-item>
<gux-icon icon-name="edit" decorative="true"></gux-icon>
Edit
</gux-list-item>
<gux-list-item>
<gux-icon icon-name="clone" decorative="true"></gux-icon>
Clone
</gux-list-item>
</gux-list>
</gux-tab-advanced>
<gux-tab-advanced tab-id="2">
<gux-icon icon-name="user-directory" decorative="true"></gux-icon>
Tab Header 2
</gux-tab-advanced>
</gux-tab-advanced-list>
<gux-tab-advanced-panel tab-id="1">
<span>Tab content 1</span>
</gux-tab-advanced-panel>
<gux-tab-advanced-panel tab-id="2">
<span>Tab content 2</span>
</gux-tab-advanced-panel>
</gux-tabs-advanced>
Steps:
dropdown-options
are not compatible withgux-tabs
, remove or use thegux-tabs-advanced
component instead
- <span slot="dropdown-options">
- <gux-tab-dropdown-option option-id="1" icon-name="edit">
- Edit
- </gux-tab-dropdown-option>
- <gux-tab-dropdown-option option-id="2" icon-name="clone">
- Clone
- </gux-tab-dropdown-option>
- </span>
- The
tab-icon-name
property has been removed. Slot the icon in thegux-tab
component. - The
title
named slot has been removed. Slot the text directly into thegux-tab
component
- <gux-tab-legacy tab-id="1" tab-icon-name="agent">
- <span slot="title">Tab Header 1</span>
- </gux-tab-legacy>
+ <gux-tab tab-id="1">
+ <gux-icon icon-name="agent" decorative="true"></gux-icon>
+ Tab Header 1
+ </gux-tab>
- Nest the
gux-tab
components within agux-tab-list
component. Theshow-new-tab-button
andallow-sort
properties are not compatible withgux-tabs
. If this functionality is needed usegux-tabs-advanced
instead
<gux-tabs-legacy>
+ <gux-tab-advanced-list slot="tab-list" show-new-tab-button="true" allow-sort="true">
<gux-tab tab-id="1">
<gux-icon icon-name="agent" decorative="true"></gux-icon>
Tab Header 1
</gux-tab>
...
+ </gux-tab-advanced-list>
...
</gux-tabs-legacy>
- For accessibility reasons, tabs need associated tab panels. Add
gux-tab-panel
components that will act as containers for your tab panel content. Associate the tab panel with its tab by setting thetab-id
property on thegux-tab
andgux-tab-panel
to the same value.
Completed Migration to gux-tabs
<gux-tabs active-tab="1">
<gux-tab-list slot="tab-list">
<gux-tab tab-id="1">
<gux-icon icon-name="agent" decorative="true"></gux-icon>
Tab Header 1
</gux-tab>
<gux-tab tab-id="2">
<gux-icon icon-name="user-directory" decorative="true"></gux-icon>
Tab Header 2
</gux-tab>
</gux-tab-list>
<gux-tab-panel tab-id="1">
<span>Tab content 1</span>
</gux-tab-panel>
<gux-tab-panel tab-id="2">
<span>Tab content 2</span>
</gux-tab-panel>
</gux-tabs>