Light Dark System

Tab Panel

<p-tab-panel> | PTabPanel
Since 1.0 stable

Tab panels are used inside tab groups to display tabbed 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.
<p-tab-group>
  <p-tab slot="nav" panel="general">General</p-tab>
  <p-tab slot="nav" panel="custom">Custom</p-tab>
  <p-tab slot="nav" panel="advanced">Advanced</p-tab>
  <p-tab slot="nav" panel="disabled" disabled>Disabled</p-tab>

  <p-tab-panel name="general">This is the general tab panel.</p-tab-panel>
  <p-tab-panel name="custom">This is the custom tab panel.</p-tab-panel>
  <p-tab-panel name="advanced">This is the advanced tab panel.</p-tab-panel>
  <p-tab-panel name="disabled">This is a disabled tab panel.</p-tab-panel>
</p-tab-group>
import PTab from 'pure-uikit/dist/react/tab';
import PTabGroup from 'pure-uikit/dist/react/tab-group';
import PTabPanel from 'pure-uikit/dist/react/tab-panel';

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

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

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.

Script Import Bundler React

To import this component from the CDN using a script tag:

<script type="module" src="https://cdn.jsdelivr.net/npm/pure-uikit@1.3.13/cdn/components/tab-panel/tab-panel.js"></script>

To import this component from the CDN using a JavaScript import:

import 'https://cdn.jsdelivr.net/npm/pure-uikit@1.3.13/cdn/components/tab-panel/tab-panel.js';

To import this component using a bundler:

import 'pure-uikit/dist/components/tab-panel/tab-panel.js';

To import this component as a React component:

import PTabPanel from 'pure-uikit/dist/react/tab-panel';

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 base wrapper.

Learn more about customizing CSS parts.