Usage
Signature:
interface CTabBarElement
Typescript Import Format
//To typecheck the element APIs, import as below.
import { CTabBarElement } from "oj-c/tab-bar";
//For the transpiled javascript to load the element's module, import as below
import "oj-c/tab-bar";
For additional information visit:
Note: Application logic should not interact with the component's properties or invoke its methods until the BusyContext indicates that the component is ready for interaction.
Attributes
-
data :(Array.<(oj-c.TabBar.TabData.<(string|number)>|oj-c.TabBar.TabLinkItemData.<(string|number)>)>|DataProvider.<K, (oj-c.TabBar.TabData.<K>|oj-c.TabBar.TabLinkItemData.<K>)>)
-
Specifies the data definitions for the tabs.
- Default Value:
[]
Names
Item Name Property dataProperty change event dataChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-data-changed -
display :"standard"|"icons"|"stacked"
-
Whether to display both the label and icons ("standard") or just the icons ("icons") or to render stacked display ("stacked"). In the latter case, the label is displayed in a tooltip instead.
- Default Value:
"standard"
Supported Values:
Value Description iconsOnly icons are shown for all tabs. stackedStacks the badge over the icon and icon over the label when applicable. standardLabel and icon are shown for all tabs. Names
Item Name Property displayProperty change event displayChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-display-changed -
edge :"top"|"bottom"
-
The position of the TabBar.
- Default Value:
"top"
Names
Item Name Property edgeProperty change event edgeChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-edge-changed -
layout :"stretch"|"condense"
-
Whether to stretch the tab bar items to occupy available space or to condense items
- Default Value:
"stretch"
Supported Values:
Value Description condenseCondenses the space occupied by tab bar items stretchStretches the tab bar items to occupy available space Names
Item Name Property layoutProperty change event layoutChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-layout-changed -
overflow :"hidden"|"popup"|"conveyor"
-
Specifies the overflow behavior
- Default Value:
"hidden"
Names
Item Name Property overflowProperty change event overflowChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-overflow-changed -
reorderable :"enabled"|"disabled"
-
Specifies if the tabs can be reordered within the tab bar. Note: Do not use with
overflow="popup"as reorder is not supported with popup.- Default Value:
"disabled"
Supported Values:
Value Description disabledDisables reordering of items in tabbar. enabledEnables reordering of items in tabbar. Names
Item Name Property reorderableProperty change event reorderableChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-reorderable-changed -
selection :K
-
The key of the currently selected tab.
- Supports writeback:
true
Names
Item Name Property selectionProperty change event selectionChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-selection-changed -
truncation :"none"|"progressive"
-
Truncation applies to the tab labels when there is not enough room to display all tabs.
- Default Value:
"none"
Names
Item Name Property truncationProperty change event truncationChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-truncation-changed
Events
-
ojBeforeSelect
-
Triggered before user selects a tab which includes user gestures or selection is changed programmatically.
Properties:
All of the event payloads listed below can be found under
event.detail. See Events and Listeners for additional information.Name Type Description acceptfunction This method can be called with an application-created Promise to cancel this event asynchronously. The Promise should be resolved or rejected to accept or cancel the event, respectively. keyK -
ojRemove
-
Triggered when user performs a remove gesture on a tab. The remove gestures include:
- User clicks the remove icon in a tab
- User presses Delete key on a tab
Properties:
All of the event payloads listed below can be found under
event.detail. See Events and Listeners for additional information.Name Type keyK -
ojReorder
-
Triggered when user performs a reorder gesture on a tab. The reorder gestures include:
- User drags a tab and drops it in a new drop location
- User presses Command + Shift + Arrow key(s) on a tab
overflow="popup"as reorder is not supported with popup.Properties:
All of the event payloads listed below can be found under
event.detail. See Events and Listeners for additional information.Name Type Description reorderedKeysArray<K> The new order of keys after reorder -
ojSelectionAction
-
Triggered when user performs a selection action gesture on a tab. The action gestures include:
- User clicks anywhere in a tab
- User taps anywhere in a tab
- User pressed spacebar or enter key on a tab
Properties:
All of the event payloads listed below can be found under
event.detail. See Events and Listeners for additional information.Name Type previousValueK valueK
Methods
-
getProperty(property) : {any}
-
Retrieves the value of a property or a subproperty.
Parameters:
Name Type Description propertyThe property name to get. Supports dot notation for subproperty access. Returns:
- Type
- any
-
setProperties(properties) : {void}
-
Performs a batch set of properties.
Parameters:
Name Type Description propertiesAn object containing the property and value pairs to set. Returns:
- Type
- void
-
setProperty(property, value) : {void}
-
Sets a property or a single subproperty for complex properties and notifies the component of the change, triggering a corresponding event.
Parameters:
Name Type Description propertyThe property name to set. Supports dot notation for subproperty access. valueThe new value to set the property to. Returns:
- Type
- void
Type Definitions
-
TabData<K extends string | number>
-
The data item object that represents a tab.
Properties:
Name Type Argument Description badgenumber <optional>
The content to be rendered inside the Badge component. icon{ type?: 'class'; class: string; } | { type: 'img'; src: string; } <optional>
The icon before the label in non-stack case, icon above the label in stacked case or the stand alone icon when no label is specified. isRemovableboolean <optional>
Renders a remove icon allowing the tabs to be removed. itemKeyK Key of the TabBarItem labelstring Label of the TabBarItem. For icon only display this label is the content for aria-label and tooltip text of the Tab. metadatastring <optional>
The content to be rendered inside the Text component as a metadata, that appears after the label in non stack case only. severity"none" | "error" | "confirmation" | "info" | "warning" <optional>
The status icon to be rendered after the label in non stack case only. tabPanelIdstring <optional>
Accepts the tabpanel element's ID associated with the tab item -
TabLinkItemData<K extends string | number>
-
The data item object that represents a tab with link. Note: Do not use with
overflow="popup"as links are currently not supported in overflow items inside a popup.Properties:
Name Type Argument Description badgenumber <optional>
The content to be rendered inside the Badge component. hrefstring Sets the URL that the hyperlink points to. If there is no valid URL use "#" for href value to navigate to the top of the page. icon{ type?: 'class'; class: string; } | { type: 'img'; src: string; } <optional>
The icon before the label in non-stack case, icon above the label in stacked case or the stand alone icon when no label is specified. itemKeyK Key of the TabBarItem labelstring Label of the TabBarItem. For icon only display this label is the content for aria-label and tooltip text of the Tab. metadatastring <optional>
The content to be rendered inside the Text component as a metadata, that appears after the label in non stack case only. severity"none" | "error" | "confirmation" | "info" | "warning" <optional>
The status icon to be rendered after the label in non stack case only. tabPanelIdstring <optional>
Accepts the tabpanel element's ID associated with the tab item