Tab Panel
<mf-tab-panel> | MfTabPanel
Tab panels are used inside tab groups to display tabbed content.
<mf-tab-group> <mf-tab slot="nav" panel="general">General</mf-tab> <mf-tab slot="nav" panel="custom">Custom</mf-tab> <mf-tab slot="nav" panel="advanced">Advanced</mf-tab> <mf-tab slot="nav" panel="disabled" disabled>Disabled</mf-tab> <mf-tab-panel name="general">This is the general tab panel.</mf-tab-panel> <mf-tab-panel name="custom">This is the custom tab panel.</mf-tab-panel> <mf-tab-panel name="advanced">This is the advanced tab panel.</mf-tab-panel> <mf-tab-panel name="disabled">This is a disabled tab panel.</mf-tab-panel> </mf-tab-group>
import MfTab from 'maf-ui-kit/dist/react/tab'; import MfTabGroup from 'maf-ui-kit/dist/react/tab-group'; import MfTabPanel from 'maf-ui-kit/dist/react/tab-panel'; const App = () => ( <MfTabGroup> <MfTab slot="nav" panel="general"> General </MfTab> <MfTab slot="nav" panel="custom"> Custom </MfTab> <MfTab slot="nav" panel="advanced"> Advanced </MfTab> <MfTab slot="nav" panel="disabled" disabled> Disabled </MfTab> <MfTabPanel name="general">This is the general tab panel.</MfTabPanel> <MfTabPanel name="custom">This is the custom tab panel.</MfTabPanel> <MfTabPanel name="advanced">This is the advanced tab panel.</MfTabPanel> <MfTabPanel name="disabled">This is a disabled tab panel.</MfTabPanel> </MfTabGroup> );
Additional demonstrations can be found in the tab group examples.
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.
To import this component from the CDN using a script tag:
<script type="module" src="https://cdn.jsdelivr.net/npm/maf-ui-kit@0.0.1/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/maf-ui-kit@0.0.1/cdn/components/tab-panel/tab-panel.js';
To import this component using a bundler:
import 'maf-ui-kit/dist/components/tab-panel/tab-panel.js';
To import this component as a React component:
import MfTabPanel from 'maf-ui-kit/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.