# Tabs

Tabs organize content across different screens, data sets, and other interactions.

# Usage

The ci-tabs component uses dynamic slots to render the tabs and the tab content. First, create a CiTabElement[] called tabs with the object { title: 'Title', pxClass: 'This,Is,PX'} you want for each tab. pxClass is not required. Then use slots for the content of each tab. The slot name with be tab- plus the corresponding tabs item title in kebab-case.

# Initial Tab

Use the initial-tab prop to define which tab is active initially. It's value should match one of the object title in tabs.

# Variants

Use the variant prop to change the appearance of your tabs.

# Alignment

Use the align prop to change the alignment of your tabs.

# Title slot

You can use title slots if you want more than a String for your tabs title. The slot name will be title- plus the corresponding tabs object title in kebab case.

# Action slot

You can use actions slot if you want to add icons or other actions to tabs. Works best with compact or subcompact, left aligned tabs.

# Flush Tabs

Use the flush prop to remove the bottom margin separating the tab controls from the tab content. This can be useful if your tab content needs custom padding.

# Events

The ci-tabs component emits a @change whenever the active tab changes.

# Reactivity

The tabs will reactively respond to changes to initial-tab, tabs or slot content.

Last Updated: 12/19/2023, 12:12:26 PM