pub struct TabsProps {Show 18 fields
pub items: Vec<TabItem>,
pub active_key: Option<String>,
pub default_active_key: Option<String>,
pub on_change: Option<EventHandler<String>>,
pub type: TabsType,
pub tab_placement: TabPlacement,
pub centered: bool,
pub hide_add: bool,
pub on_edit: Option<EventHandler<TabEditAction>>,
pub add_icon: Option<Element>,
pub remove_icon: Option<Element>,
pub more_icon: Option<Element>,
pub size: Option<ComponentSize>,
pub destroy_inactive_tab_pane: bool,
pub class: Option<String>,
pub style: Option<String>,
pub class_names: Option<TabsClassNames>,
pub styles: Option<TabsStyles>,
}Expand description
Props for the Tabs component.
Fields§
§items: Vec<TabItem>Tab items with key/label/content.
active_key: Option<String>Controlled active key. When set, Tabs becomes controlled.
default_active_key: Option<String>Default active key used in uncontrolled mode.
on_change: Option<EventHandler<String>>Called when the active tab changes.
type: TabsTypeVisual type (line/card/editable-card).
tab_placement: TabPlacementTab placement position.
centered: boolWhether to center tabs.
hide_add: boolWhether to hide the add button (for editable-card).
on_edit: Option<EventHandler<TabEditAction>>Called when tabs are added or removed (for editable-card).
add_icon: Option<Element>Custom add icon.
remove_icon: Option<Element>Custom close icon.
more_icon: Option<Element>Custom more icon (for overflow).
size: Option<ComponentSize>Visual density for tab height and typography.
destroy_inactive_tab_pane: boolWhether to destroy inactive tab panels.
class: Option<String>§style: Option<String>§class_names: Option<TabsClassNames>Semantic class names.
styles: Option<TabsStyles>Semantic styles.
Implementations§
Source§impl TabsProps
impl TabsProps
Sourcepub fn builder() -> TabsPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> TabsPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building TabsProps.
On the builder, call .items(...), .active_key(...)(optional), .default_active_key(...)(optional), .on_change(...)(optional), .r#type(...)(optional), .tab_placement(...)(optional), .centered(...)(optional), .hide_add(...)(optional), .on_edit(...)(optional), .add_icon(...)(optional), .remove_icon(...)(optional), .more_icon(...)(optional), .size(...)(optional), .destroy_inactive_tab_pane(...)(optional), .class(...)(optional), .style(...)(optional), .class_names(...)(optional), .styles(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of TabsProps.