Skip to main content

Tab

Type Alias Tab 

Source
pub type Tab<T> = ListItem<T>;
Expand description

One tab: an identifying value and the label shown on it — the same ListItem a list row is, under the name this component uses for it.

A tab and a list row need exactly the same three things (a value, a label, a disabled flag), so they are one type rather than two that must be kept in step. ["One", "Two"] converts through the From<&str> impl.

Selection is recorded as the value, not the tab’s position, so the tab row can be built from data that changes without the selection sliding onto a different tab. value is usually the same enum the app matches on to decide what to draw below the row. Values must be unique within a Tabs declaration, or selection and tab focus are ambiguous; a debug build panics on duplicates during declaration.

Aliased Type§

pub struct Tab<T> { /* private fields */ }