Skip to main content

MCDS


Tabs

A tabbed interface component for organizing content into multiple panels.

Throughout the Multiverse, the name Optimus Prime is associated with bravery, self-sacrifice, and an indomitable fighting spirit, a warrior always ready to lay down their life to protect sentient life, no matter its form.

Code

<Tabs
  tabs={[
    {
      id: "tab-1",
      label: "Tab 1",
      content: "Tab content goes here...",
      default: true
    },
    {
      id: "tab-2",
      label: "Tab 2",
      content: "Tab content goes here..."
    },
    {
      id: "tab-3",
      label: "Tab 3",
      content: "Tab content goes here..."
    }
  ]}
/>

Props

Name Type Required Description
tabs Tab[] Yes Array of tabs to display

Tab Props

Name Type Required Description
id string Yes Unique identifier for the tab
label string Yes Label text displayed on the tab
content string Yes HTML content for the tab panel
default boolean No Whether this tab should be the default active tab. If no tab is marked as default, the first tab will be selected

Usage

Do’s

  • Use for reducing cognitive load
  • Use for organizing related content into distinct sections
  • Order tabs by priority or logical sequence
  • Keep tab labels short and descriptive

Don’t’s

  • Don’t use for primary navigation
  • Don’t use too many tabs (limit to 5–7 max)
  • Don’t use for content that should be viewed all at once
  • Don’t hide critical information in non-default tabs

Accessibility

Keyboard Navigation

Screen Reader Support