Sigil

Tabs

Tabs.

Each tab adds a label and its content component; the component builds once, so a tab keeps its state while another is shown. When tabs have content, the active tab's content fills the space left below the tab strip.

GUITUIRuns in the browsertabs

Preview

Tabs, Default, light themeTabs, Default, dark theme

Usage example

fn tabs_demo() -> TabsBuilder {    tabs()        .active(signal(0_usize))        .tab("First", move || text("First tab pane").nowrap())        .tab("Second", move || text("Second tab pane").nowrap())        .tab("Third", move || text("Third tab pane").nowrap())}
fn tabs_demo() -> TabsBuilder {  tabs()    .active(signal(0_usize))    .tab("First", move || {      text("First tab pane").nowrap()    })    .tab("Second", move || {      text("Second tab pane").nowrap()    })    .tab("Third", move || {      text("Third tab pane").nowrap()    })}

States

All 12 captured states, each drawn by the window host and by the terminal host.

Default

  • Tabs, Default, light themeTabs, Default, dark theme
    Default
  • Tabs, Hover, light themeTabs, Hover, dark theme
    Hover
  • Tabs, Pressed, light themeTabs, Pressed, dark theme
    Pressed
  • Tabs, Focused, light themeTabs, Focused, dark theme
    Focused
  • Tabs, Disabled, light themeTabs, Disabled, dark theme
    Disabled
  • Tabs, Selected, light themeTabs, Selected, dark theme
    Selected

Line

  • Tabs, Line: Default, light themeTabs, Line: Default, dark theme
    Default
  • Tabs, Line: Hover, light themeTabs, Line: Hover, dark theme
    Hover
  • Tabs, Line: Pressed, light themeTabs, Line: Pressed, dark theme
    Pressed
  • Tabs, Line: Focused, light themeTabs, Line: Focused, dark theme
    Focused
  • Tabs, Line: Disabled, light themeTabs, Line: Disabled, dark theme
    Disabled
  • Tabs, Line: Selected, light themeTabs, Line: Selected, dark theme
    Selected

API

NameSignaturePurpose
tabs`fn tabs() -> TabsBuilder`; `.tab(label, component)`, `.active(Signal<usize>)`Tabs. Each tab adds a label and its content component; the component builds once, so a tab keeps its state while another is shown. When tabs have content, the active tab's content fills the space left below the tab strip.