Tab

Tabs are used inside tab groups to represent and activate tab panels.

Additional demonstrations can be found in the tab group examples.
import '@ods/components/web.tab';

Note: You only need to import a web component once in your code, as it registers itself globally when defined, allowing you to use it anywhere within your application without needing to re-import it each time you want to use the component.

Slots

NameDescription
(default)The tab's label.

Properties

Please note, both DOM properties and HTML attributes are shown in the table below. Unless otherwise specified, the property and attribute names are identical.

Property/AttributeReflectsTypeDefault
panel
string''
active
booleanfalse
closable
booleanfalse
disabled
booleanfalse
tabIndex
tabindex
number-1

Events

React EventDescriptionEvent Detail
ods-closeEmitted when the tab is closable and the close button is activated.--

Parts

NameDescription
baseThe component's base wrapper.
close-buttonThe close button, an `<ods-icon-button>`.
close-button__baseThe close button's exported `base` part.

Dependencies

This component automatically imports the following dependencies.

  • ods-icon
  • ods-icon-button

Usage

This section includes guidelines for designers and developers about the usage of this component in different contexts.

Do

  • Use Tabs to contain multiple panels of content within a single window or container
  • Use Tabs to organize similar content types related to the user needs

Dont

  • Use tabs as a primary navigation pattern - use side nav
  • Use any other components within tab groups other than tabs
  • Put related tasks on different tabs
  • Avoid nesting additional Tabs within Tab Panels

Search