Skip to content

Tab Development

Tab 1 Tab 2 Tab 3 Tab 4 Tab 1 Panel Tab 2 Panel Tab 3 Panel Tab 4 Panel
<certara-tabs name="default-tabs-example">
<certara-tab-list slot="list">
<certara-tab-item tab="tab-1">Tab 1</certara-tab-item>
<certara-tab-item tab="tab-2">Tab 2</certara-tab-item>
<certara-tab-item tab="tab-3" disabled active>Tab 3</certara-tab-item>
<certara-tab-item tab="tab-4">Tab 4</certara-tab-item>
</certara-tab-list>
<certara-tab-panel tab="tab-1">Tab 1 Panel</certara-tab-panel>
<certara-tab-panel tab="tab-2">Tab 2 Panel</certara-tab-panel>
<certara-tab-panel tab="tab-3">Tab 3 Panel</certara-tab-panel>
<certara-tab-panel tab="tab-4">Tab 4 Panel</certara-tab-panel>
</certara-tabs>

certara-tabs

The main wrapping component for all tabs. This component controls the event emitters as well as navigation for all tabbing logic.

Properties

defaultTab

Attributedefault-tab
Typestring
Defaultundefined
Requiredfalse
DescriptionThe tab to default to on first render. If navigation is used, the navigation value will override the defaultTab value.

name

Attributename
Typestring
Default'tab'
Requiredfalse
DescriptionThe name of the tab set. This is similar to an id. If there are multiple tab sets on the same page make sure their names are all unique.
Attributenavigation
Type"fragment" | "query"
Defaultundefined
Requiredfalse
DescriptionSet this attribute to utilize the URL to control tab navigation. ‘fragment’ will put the tab id in behind a hash (#). ‘query’ will put the tab id in a query param with the ‘name’ as the key. The tab specified in the URL will also be shown on initial load.

Events

NameDescriptionBubbles
certaraTabsDidChangeFired after the old tab leaves, and the new tab is shown. The ‘tab’ param will contain the ‘tab’ attribute of the newly revealed tab.false
certaraTabsWillChangeFired when a tab is about to show. This event is fired at the same time certaraTabsWillLeave is fired, but with the ‘tab’ param as the ‘tab’ attribute of the new tab.false
certaraTabsWillLeaveEvent that’s fired when a tab is about to leave. The ‘tab’ param will contain the ‘tab’ attribute of the tab that is leaving.false

Methods

NameSignatureDescription
getTab(tab: string | HTMLCertaraTabPanelElement) => Promise<HTMLCertaraTabPanelElement | undefined>Programmatically retrieve a tab panel within the tab set.
select(tab: string | HTMLCertaraTabPanelElement) => Promise<boolean>Programmatically switch to a different tab.

Slots

NameDescription
Slot for the tab panels and content
listSlot for the tab list

certara-tab-list

Properties

selectedTab

Attributeselected-tab
Typestring
Defaultundefined
Requiredfalse
DescriptionThe current selected tab within the tab list. This is used internally and doesn’t need to be set.

size

Attributesize
Type"sm"
Defaultundefined
Requiredfalse
DescriptionSize of the tabs. Only works if variant is ‘buttons’

variant

Attributevariant
Type"buttons" | "buttons-vertical" | "default" | "panel"
Default'default'
Requiredfalse
DescriptionThe variant toggle for different styles of tabs

Events

NameDescriptionBubbles
certaraTabChangedtrue

Methods

There are no public methods available for this component

Slots

NameDescription
Slot for the tab items

certara-tab-item

Properties

active

Attributeactive
Typeboolean
Defaultfalse
Requiredfalse
DescriptionBoolean value to represent if the tab panel should be shown. Used internally.

tab

Attributetab
Typestring
Defaultundefined
Requiredtrue
DescriptionThe tab name, similar to an id. This should match the ‘tab’ attribute on the panels corresponding <certara-tab-item> component and be unique to all other <certara-tab-panel> components.

Events

There are no events available for this component

Methods

NameSignatureDescription
setActive() => Promise<void>Programatically set the tab panel to be active

Slots

NameDescription
Slot to render the content to show in the tab panel

certara-tab-panel

Properties

active

Attributeactive
Typeboolean
Defaultfalse
Requiredfalse
DescriptionBoolean value to represent if the tab panel should be shown. Used internally.

tab

Attributetab
Typestring
Defaultundefined
Requiredtrue
DescriptionThe tab name, similar to an id. This should match the ‘tab’ attribute on the panels corresponding <certara-tab-item> component and be unique to all other <certara-tab-panel> components.

Events

There are no events available for this component

Methods

NameSignatureDescription
setActive() => Promise<void>Programatically set the tab panel to be active

Slots

NameDescription
Slot to render the content to show in the tab panel