Skip to content

Tabs

Show design guidelines

HTML React Angular
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>

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

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.
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
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.
NameDescription
Slot for the tab panels and content
listSlot for the tab list

The wrapping component for the tab items. Handles logic for toggling tabs.

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
NameDescriptionBubbles
certaraTabChangedtrue

There are no public methods available for this component

NameDescription
Slot for the tab items

Component for the tab items.

disabled

Attributedisabled
Typeboolean
Defaultfalse
Requiredfalse
DescriptionBooelan value to disable the tab

errorNotification

Attributeerror-notification
Typestring
Defaultundefined
Requiredfalse
DescriptionMessage to display in a red certara-pill within the tab. This typically should be a number to represent the number of errors within a tab. Currently, styles are only supported for vertical-button tab variants.

href

Attributehref
Typestring
Defaultundefined
Requiredfalse
DescriptionUse href to provide a link if the tab needs to navigate to a new page

rel

Attributerel
Typestring
Defaultundefined
Requiredfalse
Descriptionrel to be used intandem with href if necessary

selected

Attributeselected
Typeboolean
Defaultfalse
Requiredfalse
DescriptionBoolean value to represent if the tab is currently selected or not. Used internally and does not need to be set by consumers.

tab

Attributetab
Typestring
Defaultundefined
Requiredfalse
DescriptionThe name of the tab, similar to an id. This must match the ‘tab’ attribute in the coresponding certata-tab-panel component and be unique to other tab items.

target

Attributetarget
Type"_blank" | "_parent" | "_self" | "_top" | "_unfencedTop"
Defaultundefined
Requiredfalse
Descriptiontarget to be used in tandem with href if necessary
NameDescriptionBubbles
certaraTabItemClickEvent fired when the tab is clickedtrue

There are no public methods available for this component

NameDescription
Slot for rendering the content to show in the tab item.

Component to hold the main content for the tab

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.

There are no events available for this component

NameSignatureDescription
setActive() => Promise<void>Programatically set the tab panel to be active
NameDescription
Slot to render the content to show in the tab panel