Skip to main content
Since Shoelace 2.0 Code stable Pattern stable Figma ready

Tab Panel

sl-tab-panel

Tab panels are used inside tab groups to display tabbed content.

Examples

Basic Tab Panel

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.
<sl-tab-group>
  <sl-tab slot="nav" panel="general">General</sl-tab>
  <sl-tab slot="nav" panel="custom">Custom</sl-tab>
  <sl-tab slot="nav" panel="advanced">Advanced</sl-tab>
  <sl-tab slot="nav" panel="disabled" disabled>Disabled</sl-tab>

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

Component Props

Property Default Details
name ''

string

The tab panel’s name.

active false

boolean

When true, the tab panel will be shown.

updateComplete A read-only promise that resolves when the component has finished updating.

Learn more about attributes and properties.

Slots

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

Learn more about using slots.

Custom Properties

Name Details
--padding

The tab panel’s padding.

Learn more about customizing CSS custom properties.

CSS Parts

Name Description
base The component’s base wrapper.

Learn more about customizing CSS parts.