Back to Tuist

TabMenu

noora/docs/components/tabmenu.md

4.204.02.3 KB
Original Source
<!-- Generated by scripts/generate-web-components.js. Do not edit directly. -->

TabMenu

Switches between related views or navigation destinations.

html
<noora-tab-menu value="overview">
  <noora-tab-item value="overview">Overview</noora-tab-item>
  <noora-tab-item value="settings">Settings</noora-tab-item>
</noora-tab-menu>

Attributes

AttributeType or allowed valuesDefaultDescription
orientationhorizontal, vertical"horizontal"Controls the menu layout.
valuestringNoneGets or sets the selected item value.

Properties

PropertyType or allowed valuesDefaultDescription
itemsArray<Record<string, unknown>>[]Defines tabs programmatically when declarative noora-tab-item children are not used.

Events

EventTypeDescription
noora-tab-changeCustomEvent<{ item: Record<string, unknown>; value: unknown }>Emitted when an enabled tab is selected.

Slots

SlotDescription
defaultDeclarative noora-tab-item children.

Styling parts

PartDescription
menuThe menu container.
itemEach tab item.

Selection emits a noora-tab-change event.

Horizontal tabs

Switch between sibling views.

html
<noora-tab-menu value="general">
  <noora-tab-item value="general" icon="category">General</noora-tab-item>
  <noora-tab-item value="settings">Settings</noora-tab-item>
  <noora-tab-item value="members">Members</noora-tab-item>
</noora-tab-menu>

Vertical tabs

Use labels with left, right, or paired icons.

html
<noora-tab-menu orientation="vertical">
  <noora-tab-item value="dashboard">Dashboard</noora-tab-item>
  <noora-tab-item value="analytics" icon="category">Analytics</noora-tab-item>
  <noora-tab-item value="settings" right-icon="category">Settings</noora-tab-item>
  <noora-tab-item value="users" icon="category" right-icon="category">Users</noora-tab-item>
</noora-tab-menu>

Vertical edge cases

Handle especially long and short labels.

html
<noora-tab-menu orientation="vertical">
  <noora-tab-item value="long">Very Long Tab Label That Might Wrap</noora-tab-item>
  <noora-tab-item value="short">A</noora-tab-item>
</noora-tab-menu>