Skip to main content

TabItem

TabItem is the data record used by Tabs.

Each item defines one labeled tab and the content that should appear when that tab is active. The parent Tabs widget chooses which item's content is actually rendered by comparing its index to active_index.

Example

use fission::prelude::*;

let item = TabItem {
title: "Security".into(),
content: security_panel_node,
on_press: Some(select_security_tab_action),
};

Field table

FieldTypeMeaningNotes / default behavior
titleStringVisible label for the tab button.Required.
contentNodePanel content for this tab.Required. Only the active tab's content is shown.
on_pressOption<ActionEnvelope>Action fired when the tab is chosen.Defaults to None. Usually sets the active index in state.

Specific advice

Keep tab titles short and parallel. Tabs work best when users can compare section names at a glance.

Tabs, Accordion, Button, and Text.