Skip to main content

Tab

<gstock-tab> | GstockTab

API

Properties

Name Description Reflects Type Default
active Draws the tab in an active state. Reflects boolean false
closable Makes the tab closable and shows a close button. boolean false
disabled Disables the tab and prevents selection. Reflects boolean false
icon Icon name of the tab. Reflects string | undefined -
panel The name of the tab panel this tab is associated with. The panel must be located in the same tab group. Reflects string ''
color The color of the tab. Reflects 'primary' | 'secondary' 'primary'
download Tells the browser to download the linked file as this filename. Only used when href is present. string | undefined -
href When set, the underlying button will be rendered as an <a> with this href instead of a <div>. string ''
rel When using href, this attribute will map to the underlying link’s rel attribute. Unlike regular links, the default is noreferrer noopener to prevent security exploits. However, if you’re using target to point to a specific tab/window, this will prevent that from working correctly. You can remove or change the default value by setting the attribute to an empty string or a value of your choice, respectively. string 'noreferrer noopener'
target Tells the browser where to open the link. Only used when href is present. '_blank' | '_parent' | '_self' | '_top' -
updateComplete

A read-only promise that resolves when the component has finished updating.

Learn more about attributes and properties .

Events

Name React Event Description Event Detail
gstock-close-event onGstockCloseEvent Emitted when the tab is closable and the close button is activated. CustomEvent

Learn more about events .

Slots

Name Description
default -The label of the tab.

Learn more about slots .

Methods

Name Description
focus(
options: FocusOptions
)
Sets focus to the tab.
blur( ) Removes focus from the tab.

Learn more about methods .

CSS Parts

Name Description
base The component’s base wrapper.
close-button The close button, an <gstock-icon-button>.
close-button__base The close button’s exported base part.

Learn more about CSS parts .

Dependencies

This component automatically imports the following dependencies.