Skip to main content
Default Gray Amethyst

Tab Panel

<mo-tab-panel> | MOTabPanel
Since 1.0 stable

Tab panels are used inside tab groups to represent and display tab content.

General Custom Advanced Disabled This is the general tab panel. This is the custom tab panel. This is the advanced tab panel. This is a disabled tab panel.
<mo-tab-group>
  <mo-tab slot="nav" panel="general">General</mo-tab>
  <mo-tab slot="nav" panel="custom">Custom</mo-tab>
  <mo-tab slot="nav" panel="advanced">Advanced</mo-tab>
  <mo-tab slot="nav" panel="disabled" disabled>Disabled</mo-tab>

  <mo-tab-panel name="general">This is the general tab panel.</mo-tab-panel>
  <mo-tab-panel name="custom">This is the custom tab panel.</mo-tab-panel>
  <mo-tab-panel name="advanced">This is the advanced tab panel.</mo-tab-panel>
  <mo-tab-panel name="disabled">This is a disabled tab panel.</mo-tab-panel>
</mo-tab-group>
import { MOTab, MOTabGroup, MOTabPanel } from '@metsooutotec/modes-web-components/dist/react';

const App = () => (
  <MOTabGroup>
    <MOTab slot="nav" panel="general">
      General
    </MOTab>
    <MOTab slot="nav" panel="custom">
      Custom
    </MOTab>
    <MOTab slot="nav" panel="advanced">
      Advanced
    </MOTab>
    <MOTab slot="nav" panel="disabled" disabled>
      Disabled
    </MOTab>

    <MOTabPanel name="general">This is the general tab panel.</MOTabPanel>
    <MOTabPanel name="custom">This is the custom tab panel.</MOTabPanel>
    <MOTabPanel name="advanced">This is the advanced tab panel.</MOTabPanel>
    <MOTabPanel name="disabled">This is a disabled tab panel.</MOTabPanel>
  </MOTabGroup>
);

Importing

If you’re using the autoloader or the traditional loader, you can ignore this section. Otherwise, feel free to use any of the following snippets to cherry pick this component.

Bundler React Script

To import this component using a bundler:

import '@metsooutotec/modes-web-components/dist/components/tab-panel/tab-panel.js';

To import this component as a React component:

import MOTabPanel from '@metsooutotec/modes-web-components/dist/react/tab-panel/';

To import this component using a script tag:

<script type="module" src="https://modes-web.metso.com/dist/components/cdn/components/tab-panel/tab-panel.js"></script>

Slots

Name Description
(default) The tab panel’s content.

Learn more about using slots.

Properties

Name Description Reflects Type Default
name The tab panel’s name. string ''
active When true, the tab panel will be shown. boolean false
updateComplete A read-only promise that resolves when the component has finished updating.

Learn more about attributes and properties.

Custom Properties

Name Description Default
--padding The tab panel’s padding.

Learn more about customizing CSS custom properties.

Parts

Name Description
base The component’s internal wrapper.

Learn more about customizing CSS parts.